iommu/amd: Add call-back routine for HPET MSI

Add a routine to setup a HPET MSI interrupt for remapping.

Signed-off-by: Joerg Roedel <ebd221a096cbc71dd9e1991db28795933c85f380@amd.com>

--- drivers/iommu/amd_iommu.c
+++ drivers/iommu/amd_iommu.c
@@ -4200,4 +4200,30 @@
 	return 0;
 }

+static int setup_hpet_msi(unsigned int irq, unsigned int id)
+{
+	struct irq_2_iommu *irte_info;
+	struct irq_cfg *cfg;
+	int index, devid;
+
+	cfg = irq_get_chip_data(irq);
+	if (!cfg)
+		return -EINVAL;
+
+	irte_info = &cfg->irq_2_iommu;
+	devid     = get_hpet_devid(id);
+	if (devid < 0)
+		return devid;
+
+	index = alloc_irq_index(cfg, devid, 1);
+	if (index < 0)
+		return index;
+
+	irte_info->sub_handle = devid;
+	irte_info->irte_index = index;
+	irte_info->iommu      = (void *)cfg;
+
+	return 0;
+}
+
 #endif


ACPI: video: remove unneeded memsets

ACPI: video: remove unneeded memsets

device->cap and video->cap are zeroed initially so we don't need to clear
them again.

Signed-off-by: Zhang Rui <f2a4cf793007be8f81a774dc7806c1ffea7b4a2c@intel.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>

--- drivers/acpi/video.c
+++ drivers/acpi/video.c
@@ -934,9 +934,6 @@
 {
 	acpi_handle h_dummy1;

-
-	memset(&device->cap, 0, sizeof(device->cap));
-
 	if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
 		device->cap._ADR = 1;
 	}
@@ -1039,7 +1036,6 @@
 {
 	acpi_handle h_dummy1;

-	memset(&video->cap, 0, sizeof(video->cap));
 	if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
 		video->cap._DOS = 1;
 	}


i4l: errors with assignments in if

i4l: errors with assignments in if

Signed-off-by: Roel Kluin <e18d74b914d880e021734ee3329e838c0a50e849@tiscali.nl>
Acked-by: Karsten Keil <90bd3ab5dfafb0210c2bd99c94885684b79eea73@suse.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- drivers/isdn/hisax/elsa.c
+++ drivers/isdn/hisax/elsa.c
@@ -883,7 +883,7 @@
 	val += 'A' - 3;
 	if (val == 'B' || val == 'C')
 		val ^= 1;
-	if ((cs->subtyp == ELSA_PCFPRO) && (val = 'G'))
+	if ((cs->subtyp == ELSA_PCFPRO) && (val == 'G'))
 		val = 'C';
 	printk(KERN_INFO
 	       "Elsa: %s found at %#lx Rev.:%c IRQ %d\n",


The C wrapper has been fixed

The C wrapper has been fixed

--- src/cal3d/cal3d_wrapper.h
+++ src/cal3d/cal3d_wrapper.h
@@ -25,6 +25,7 @@

 #pragma warning(disable : 4251)
 #pragma warning(disable : 4786)
+#pragma warning(disable : 4099)

 #ifdef CAL3D_WRAPPER_EXPORTS
 #define CAL3D_WRAPPER_API __declspec(dllexport)
@@ -65,7 +66,6 @@
 struct CalCoreSkeleton;
 struct CalCoreSubmesh;
 struct CalCoreTrack;
-struct CalIndex;
 struct CalLoader;
 struct CalMatrix;
 struct CalMesh;
@@ -80,8 +80,11 @@
 struct CalSpringSystem;
 struct CalSubmesh;
 struct CalVector;
+typedef CalIndex;

 #endif
+
+

 typedef void *CalUserData;

@@ -126,243 +129,243 @@
     ANIMATION_STATE_OUT
   };

-  CAL3D_WRAPPER_API Boolean CalAnimation_Create(CalAnimation *self, CalCoreAnimation *pCoreAnimation);
-  CAL3D_WRAPPER_API void CalAnimation_Delete(CalAnimation *self);
-  CAL3D_WRAPPER_API void CalAnimation_Destroy(CalAnimation *self);
-  CAL3D_WRAPPER_API CalCoreAnimation *CalAnimation_GetCoreAnimation(CalAnimation *self);
-  CAL3D_WRAPPER_API CalAnimationState CalAnimation_GetState(CalAnimation *self);
-  CAL3D_WRAPPER_API float CalAnimation_GetTime(CalAnimation *self);
-  CAL3D_WRAPPER_API CalAnimationType CalAnimation_GetType(CalAnimation *self);
-  CAL3D_WRAPPER_API float CalAnimation_GetWeight(CalAnimation *self);
+  CAL3D_WRAPPER_API enum Boolean CalAnimation_Create(struct CalAnimation *self, struct  CalCoreAnimation *pCoreAnimation);
+  CAL3D_WRAPPER_API void CalAnimation_Delete(struct CalAnimation *self);
+  CAL3D_WRAPPER_API void CalAnimation_Destroy(struct CalAnimation *self);
+  CAL3D_WRAPPER_API struct CalCoreAnimation *CalAnimation_GetCoreAnimation(struct CalAnimation *self);
+  CAL3D_WRAPPER_API enum CalAnimationState CalAnimation_GetState(struct CalAnimation *self);
+  CAL3D_WRAPPER_API float CalAnimation_GetTime(struct CalAnimation *self);
+  CAL3D_WRAPPER_API enum CalAnimationType CalAnimation_GetType(struct CalAnimation *self);
+  CAL3D_WRAPPER_API float CalAnimation_GetWeight(struct CalAnimation *self);

 //****************************************************************************//
 // CalAnimationAction wrapper functions declaration                           //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalAnimationAction_Create(CalAnimationAction *self, CalCoreAnimation *pCoreAnimation);
-  CAL3D_WRAPPER_API void CalAnimationAction_Delete(CalAnimationAction *self);
-  CAL3D_WRAPPER_API void CalAnimationAction_Destroy(CalAnimationAction *self);
-  CAL3D_WRAPPER_API Boolean CalAnimationAction_Execute(CalAnimationAction *self, float delayIn, float delayOut);
-  CAL3D_WRAPPER_API CalAnimationAction *CalAnimationAction_New();
-  CAL3D_WRAPPER_API Boolean CalAnimationAction_Update(CalAnimationAction *self, float deltaTime);
+  CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Create(struct CalAnimationAction *self, struct  CalCoreAnimation *pCoreAnimation);
+  CAL3D_WRAPPER_API void CalAnimationAction_Delete(struct CalAnimationAction *self);
+  CAL3D_WRAPPER_API void CalAnimationAction_Destroy(struct CalAnimationAction *self);
+  CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Execute(struct CalAnimationAction *self, float delayIn, float delayOut);
+  CAL3D_WRAPPER_API struct CalAnimationAction *CalAnimationAction_New();
+  CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Update(struct CalAnimationAction *self, float deltaTime);

 //****************************************************************************//
 // CalAnimationCycle wrapper functions declaration                            //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalAnimationCycle_Blend(CalAnimationCycle *self, float weight, float delay);
-  CAL3D_WRAPPER_API Boolean CalAnimationCycle_Create(CalAnimationCycle *self, CalCoreAnimation *pCoreAnimation);
-  CAL3D_WRAPPER_API void CalAnimationCycle_Delete(CalAnimationCycle *self);
-  CAL3D_WRAPPER_API void CalAnimationCycle_Destroy(CalAnimationCycle *self);
-  CAL3D_WRAPPER_API CalAnimationCycle *CalAnimationCycle_New();
-  CAL3D_WRAPPER_API void CalAnimationCycle_SetAsync(CalAnimationCycle *self, float time, float duration);
-  CAL3D_WRAPPER_API Boolean CalAnimationCycle_Update(CalAnimationCycle *self, float deltaTime);
+  CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Blend(struct CalAnimationCycle *self, float weight, float delay);
+  CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Create(struct CalAnimationCycle *self, struct  CalCoreAnimation *pCoreAnimation);
+  CAL3D_WRAPPER_API void CalAnimationCycle_Delete(struct CalAnimationCycle *self);
+  CAL3D_WRAPPER_API void CalAnimationCycle_Destroy(struct CalAnimationCycle *self);
+  CAL3D_WRAPPER_API struct CalAnimationCycle *CalAnimationCycle_New();
+  CAL3D_WRAPPER_API void CalAnimationCycle_SetAsync(struct CalAnimationCycle *self, float time, float duration);
+  CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Update(struct CalAnimationCycle *self, float deltaTime);

 //****************************************************************************//
 // CalBone wrapper functions declaration                                      //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalBone_BlendState(CalBone *self, float weight, CalVector *pTranslation, CalQuaternion *pRotation);
-  CAL3D_WRAPPER_API void CalBone_CalculateState(CalBone *self);
-  CAL3D_WRAPPER_API void CalBone_ClearState(CalBone *self);
-  CAL3D_WRAPPER_API Boolean CalBone_Create(CalBone *self, CalCoreBone *pCoreBone);
-  CAL3D_WRAPPER_API void CalBone_Delete(CalBone *self);
-  CAL3D_WRAPPER_API void CalBone_Destroy(CalBone *self);
-  CAL3D_WRAPPER_API CalCoreBone *CalBone_GetCoreBone(CalBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalBone_GetRotation(CalBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalBone_GetRotationAbsolute(CalBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalBone_GetRotationBoneSpace(CalBone *self);
-  CAL3D_WRAPPER_API CalVector *CalBone_GetTranslation(CalBone *self);
-  CAL3D_WRAPPER_API CalVector *CalBone_GetTranslationAbsolute(CalBone *self);
-  CAL3D_WRAPPER_API CalVector *CalBone_GetTranslationBoneSpace(CalBone *self);
-  CAL3D_WRAPPER_API void CalBone_LockState(CalBone *self);
-  CAL3D_WRAPPER_API CalBone *CalBone_New();
-  CAL3D_WRAPPER_API void CalBone_SetSkeleton(CalBone *self, CalSkeleton *pSkeleton);
+  CAL3D_WRAPPER_API void CalBone_BlendState(struct CalBone *self, float weight, struct CalVector *pTranslation, struct CalQuaternion *pRotation);
+  CAL3D_WRAPPER_API void CalBone_CalculateState(struct CalBone *self);
+  CAL3D_WRAPPER_API void CalBone_ClearState(struct CalBone *self);
+  CAL3D_WRAPPER_API enum Boolean CalBone_Create(struct CalBone *self, struct CalCoreBone *pCoreBone);
+  CAL3D_WRAPPER_API void CalBone_Delete(struct CalBone *self);
+  CAL3D_WRAPPER_API void CalBone_Destroy(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalCoreBone *CalBone_GetCoreBone(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalBone_GetRotation(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalBone_GetRotationAbsolute(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalBone_GetRotationBoneSpace(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalBone_GetTranslation(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalBone_GetTranslationAbsolute(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalBone_GetTranslationBoneSpace(struct CalBone *self);
+  CAL3D_WRAPPER_API void CalBone_LockState(struct CalBone *self);
+  CAL3D_WRAPPER_API struct CalBone *CalBone_New();
+  CAL3D_WRAPPER_API void CalBone_SetSkeleton(struct CalBone *self, struct CalSkeleton *pSkeleton);

 //****************************************************************************//
 // CalCoreAnimation wrapper functions declaration                             //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreAnimation_AddCoreTrack(CalCoreAnimation *self, CalCoreTrack *pCoreTrack);
-  CAL3D_WRAPPER_API Boolean CalCoreAnimation_Create(CalCoreAnimation *self);
-  CAL3D_WRAPPER_API void CalCoreAnimation_Delete(CalCoreAnimation *self);
-  CAL3D_WRAPPER_API void CalCoreAnimation_Destroy(CalCoreAnimation *self);
-  CAL3D_WRAPPER_API CalCoreTrack *CalCoreAnimation_GetCoreTrack(CalCoreAnimation *self, int coreBoneId);
-  CAL3D_WRAPPER_API float CalCoreAnimation_GetDuration(CalCoreAnimation *self);
-//  CAL3D_WRAPPER_API std::list<CalCoreTrack *>& CalCoreAnimation_GetListCoreTrack(CalCoreAnimation *self);
-  CAL3D_WRAPPER_API CalCoreAnimation *CalCoreAnimation_New();
-  CAL3D_WRAPPER_API void CalCoreAnimation_SetDuration(CalCoreAnimation *self, float duration);
+  CAL3D_WRAPPER_API enum Boolean CalCoreAnimation_AddCoreTrack(struct CalCoreAnimation *self, struct CalCoreTrack *pCoreTrack);
+  CAL3D_WRAPPER_API enum Boolean CalCoreAnimation_Create(struct CalCoreAnimation *self);
+  CAL3D_WRAPPER_API void CalCoreAnimation_Delete(struct CalCoreAnimation *self);
+  CAL3D_WRAPPER_API void CalCoreAnimation_Destroy(struct CalCoreAnimation *self);
+  CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreAnimation_GetCoreTrack(struct CalCoreAnimation *self, int coreBoneId);
+  CAL3D_WRAPPER_API float CalCoreAnimation_GetDuration(struct CalCoreAnimation *self);
+//  CAL3D_WRAPPER_API std::list<CalCoreTrack *>& CalCoreAnimation_GetListCoreTrack(struct CalCoreAnimation *self);
+  CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreAnimation_New();
+  CAL3D_WRAPPER_API void CalCoreAnimation_SetDuration(struct CalCoreAnimation *self, float duration);

 //****************************************************************************//
 // CalCoreBone wrapper functions declaration                                  //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreBone_AddChildId(CalCoreBone *self, int childId);
-  CAL3D_WRAPPER_API void CalCoreBone_CalculateState(CalCoreBone *self);
-  CAL3D_WRAPPER_API Boolean CalCoreBone_Create(CalCoreBone *self, char *strName);
-  CAL3D_WRAPPER_API void CalCoreBone_Delete(CalCoreBone *self);
-  CAL3D_WRAPPER_API void CalCoreBone_Destroy(CalCoreBone *self);
-//  CAL3D_WRAPPER_API std::list<int>& CalCoreBone_GetListChildId(CalCoreBone *self);
-  CAL3D_WRAPPER_API char *CalCoreBone_GetName(CalCoreBone *self);
-  CAL3D_WRAPPER_API int CalCoreBone_GetParentId(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalCoreBone_GetRotation(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalCoreBone_GetRotationAbsolute(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalCoreBone_GetRotationBoneSpace(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalVector *CalCoreBone_GetTranslation(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalVector *CalCoreBone_GetTranslationAbsolute(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalVector *CalCoreBone_GetTranslationBoneSpace(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalUserData CalCoreBone_GetUserData(CalCoreBone *self);
-  CAL3D_WRAPPER_API CalCoreBone *CalCoreBone_New();
-  CAL3D_WRAPPER_API void CalCoreBone_SetCoreSkeleton(CalCoreBone *self, CalCoreSkeleton *pCoreSkeleton);
-  CAL3D_WRAPPER_API void CalCoreBone_SetParentId(CalCoreBone *self, int parentId);
-  CAL3D_WRAPPER_API void CalCoreBone_SetRotation(CalCoreBone *self, CalQuaternion *pRotation);
-  CAL3D_WRAPPER_API void CalCoreBone_SetRotationBoneSpace(CalCoreBone *self, CalQuaternion *pRotation);
-  CAL3D_WRAPPER_API void CalCoreBone_SetTranslation(CalCoreBone *self, CalVector *pTranslation);
-  CAL3D_WRAPPER_API void CalCoreBone_SetTranslationBoneSpace(CalCoreBone *self, CalVector *pTranslation);
-  CAL3D_WRAPPER_API void CalCoreBone_SetUserData(CalCoreBone *self, CalUserData userData);
+  CAL3D_WRAPPER_API enum Boolean CalCoreBone_AddChildId(struct CalCoreBone *self, int childId);
+  CAL3D_WRAPPER_API void CalCoreBone_CalculateState(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API enum Boolean CalCoreBone_Create(struct CalCoreBone *self, char *strName);
+  CAL3D_WRAPPER_API void CalCoreBone_Delete(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API void CalCoreBone_Destroy(struct CalCoreBone *self);
+//  CAL3D_WRAPPER_API std::list<int>& CalCoreBone_GetListChildId(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API char *CalCoreBone_GetName(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API int CalCoreBone_GetParentId(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalCoreBone_GetRotation(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalCoreBone_GetRotationAbsolute(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalCoreBone_GetRotationBoneSpace(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalCoreBone_GetTranslation(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalCoreBone_GetTranslationAbsolute(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalVector *CalCoreBone_GetTranslationBoneSpace(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API CalUserData CalCoreBone_GetUserData(struct CalCoreBone *self);
+  CAL3D_WRAPPER_API struct CalCoreBone *CalCoreBone_New();
+  CAL3D_WRAPPER_API void CalCoreBone_SetCoreSkeleton(struct CalCoreBone *self, struct CalCoreSkeleton *pCoreSkeleton);
+  CAL3D_WRAPPER_API void CalCoreBone_SetParentId(struct CalCoreBone *self, int parentId);
+  CAL3D_WRAPPER_API void CalCoreBone_SetRotation(struct CalCoreBone *self, struct CalQuaternion *pRotation);
+  CAL3D_WRAPPER_API void CalCoreBone_SetRotationBoneSpace(struct CalCoreBone *self, struct CalQuaternion *pRotation);
+  CAL3D_WRAPPER_API void CalCoreBone_SetTranslation(struct CalCoreBone *self, struct CalVector *pTranslation);
+  CAL3D_WRAPPER_API void CalCoreBone_SetTranslationBoneSpace(struct CalCoreBone *self, struct CalVector *pTranslation);
+  CAL3D_WRAPPER_API void CalCoreBone_SetUserData(struct CalCoreBone *self, CalUserData userData);

 //****************************************************************************//
 // CalCoreKeyframe wrapper functions declaration                              //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreKeyframe_Create(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API void CalCoreKeyframe_Delete(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API void CalCoreKeyframe_Destroy(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API CalQuaternion *CalCoreKeyframe_GetRotation(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API float CalCoreKeyframe_GetTime(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API CalVector *CalCoreKeyframe_GetTranslation(CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API CalCoreKeyframe *CalCoreKeyframe_New();
-  CAL3D_WRAPPER_API void CalCoreKeyframe_SetRotation(CalCoreKeyframe *self, CalQuaternion *pRotation);
-  CAL3D_WRAPPER_API void CalCoreKeyframe_SetTime(CalCoreKeyframe *self, float time);
-  CAL3D_WRAPPER_API void CalCoreKeyframe_SetTranslation(CalCoreKeyframe *self, CalVector *pTranslation);
+  CAL3D_WRAPPER_API enum Boolean CalCoreKeyframe_Create(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API void CalCoreKeyframe_Delete(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API void CalCoreKeyframe_Destroy(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalCoreKeyframe_GetRotation(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API float CalCoreKeyframe_GetTime(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API struct CalVector *CalCoreKeyframe_GetTranslation(struct CalCoreKeyframe *self);
+  CAL3D_WRAPPER_API struct CalCoreKeyframe *CalCoreKeyframe_New();
+  CAL3D_WRAPPER_API void CalCoreKeyframe_SetRotation(struct CalCoreKeyframe *self, struct CalQuaternion *pRotation);
+  CAL3D_WRAPPER_API void CalCoreKeyframe_SetTime(struct CalCoreKeyframe *self, float time);
+  CAL3D_WRAPPER_API void CalCoreKeyframe_SetTranslation(struct CalCoreKeyframe *self, struct CalVector *pTranslation);

 //****************************************************************************//
 // CalCoreMaterial wrapper functions declaration                              //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreMaterial_Create(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API void CalCoreMaterial_Delete(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API void CalCoreMaterial_Destroy(CalCoreMaterial *self);
-//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetAmbientColor(CalCoreMaterial *self);
-//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetDiffuseColor(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API int CalCoreMaterial_GetMapCount(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API char *CalCoreMaterial_GetMapFilename(CalCoreMaterial *self, int mapId);
-  CAL3D_WRAPPER_API CalUserData CalCoreMaterial_GetMapUserData(CalCoreMaterial *self, int mapId);
-  CAL3D_WRAPPER_API float CalCoreMaterial_GetShininess(CalCoreMaterial *self);
-//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetSpecularColor(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API CalUserData CalCoreMaterial_GetUserData(CalCoreMaterial *self);
-//  CAL3D_WRAPPER_API std::vector<Map>& CalCoreMaterial_GetVectorMap(CalCoreMaterial *self);
-  CAL3D_WRAPPER_API CalCoreMaterial *CalCoreMaterial_New();
-  CAL3D_WRAPPER_API Boolean CalCoreMaterial_Reserve(CalCoreMaterial *self, int mapCount);
-//  CAL3D_WRAPPER_API void CalCoreMaterial_SetAmbientColor(CalCoreMaterial *self, CalCoreMaterial::Color *pAmbientColor);
-//  CAL3D_WRAPPER_API void CalCoreMaterial_SetDiffuseColor(CalCoreMaterial *self, CalCoreMaterial::Color *pDiffuseColor);
-//  CAL3D_WRAPPER_API Boolean CalCoreMaterial_SetMap(CalCoreMaterial *self, int mapId, CalCoreMaterial::Map *pMap);
-  CAL3D_WRAPPER_API Boolean CalCoreMaterial_SetMapUserData(CalCoreMaterial *self, int mapId, CalUserData userData);
-  CAL3D_WRAPPER_API void CalCoreMaterial_SetShininess(CalCoreMaterial *self, float shininess);
-//  CAL3D_WRAPPER_API void CalCoreMaterial_SetSpecularColor(CalCoreMaterial *self, CalCoreMaterial::Color *pSpecularColor);
-  CAL3D_WRAPPER_API void CalCoreMaterial_SetUserData(CalCoreMaterial *self, CalUserData userData);
+  CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_Create(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API void CalCoreMaterial_Delete(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API void CalCoreMaterial_Destroy(struct CalCoreMaterial *self);
+//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetAmbientColor(struct CalCoreMaterial *self);
+//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetDiffuseColor(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API int CalCoreMaterial_GetMapCount(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API char *CalCoreMaterial_GetMapFilename(struct CalCoreMaterial *self, int mapId);
+  CAL3D_WRAPPER_API CalUserData CalCoreMaterial_GetMapUserData(struct CalCoreMaterial *self, int mapId);
+  CAL3D_WRAPPER_API float CalCoreMaterial_GetShininess(struct CalCoreMaterial *self);
+//  CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetSpecularColor(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API CalUserData CalCoreMaterial_GetUserData(struct CalCoreMaterial *self);
+//  CAL3D_WRAPPER_API std::vector<Map>& CalCoreMaterial_GetVectorMap(struct CalCoreMaterial *self);
+  CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreMaterial_New();
+  CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_Reserve(struct CalCoreMaterial *self, int mapCount);
+//  CAL3D_WRAPPER_API void CalCoreMaterial_SetAmbientColor(struct CalCoreMaterial *self, struct CalCoreMaterial::Color *pAmbientColor);
+//  CAL3D_WRAPPER_API void CalCoreMaterial_SetDiffuseColor(struct CalCoreMaterial *self, struct CalCoreMaterial::Color *pDiffuseColor);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_SetMap(struct CalCoreMaterial *self, int mapId, struct CalCoreMaterial::Map *pMap);
+  CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_SetMapUserData(struct CalCoreMaterial *self, int mapId, CalUserData userData);
+  CAL3D_WRAPPER_API void CalCoreMaterial_SetShininess(struct CalCoreMaterial *self, float shininess);
+//  CAL3D_WRAPPER_API void CalCoreMaterial_SetSpecularColor(struct CalCoreMaterial *self, struct CalCoreMaterial::Color *pSpecularColor);
+  CAL3D_WRAPPER_API void CalCoreMaterial_SetUserData(struct CalCoreMaterial *self, CalUserData userData);

 //****************************************************************************//
 // CalCoreMesh wrapper functions declaration                                  //
 //****************************************************************************//

-  CAL3D_WRAPPER_API int CalCoreMesh_AddCoreSubmesh(CalCoreMesh *self, CalCoreSubmesh *pCoreSubmesh);
-  CAL3D_WRAPPER_API Boolean CalCoreMesh_Create(CalCoreMesh *self);
-  CAL3D_WRAPPER_API void CalCoreMesh_Delete(CalCoreMesh *self);
-  CAL3D_WRAPPER_API void CalCoreMesh_Destroy(CalCoreMesh *self);
-  CAL3D_WRAPPER_API CalCoreSubmesh *CalCoreMesh_GetCoreSubmesh(CalCoreMesh *self, int id);
-  CAL3D_WRAPPER_API int CalCoreMesh_GetCoreSubmeshCount(CalCoreMesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh *>& CalCoreMesh_GetVectorCoreSubmesh(CalCoreMesh *self);
-  CAL3D_WRAPPER_API CalCoreMesh *CalCoreMesh_New();
+  CAL3D_WRAPPER_API int CalCoreMesh_AddCoreSubmesh(struct CalCoreMesh *self, struct CalCoreSubmesh *pCoreSubmesh);
+  CAL3D_WRAPPER_API enum Boolean CalCoreMesh_Create(struct CalCoreMesh *self);
+  CAL3D_WRAPPER_API void CalCoreMesh_Delete(struct CalCoreMesh *self);
+  CAL3D_WRAPPER_API void CalCoreMesh_Destroy(struct CalCoreMesh *self);
+  CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreMesh_GetCoreSubmesh(struct CalCoreMesh *self, int id);
+  CAL3D_WRAPPER_API int CalCoreMesh_GetCoreSubmeshCount(struct CalCoreMesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh *>& CalCoreMesh_GetVectorCoreSubmesh(struct CalCoreMesh *self);
+  CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreMesh_New();

 //****************************************************************************//
 // CalCoreModel wrapper functions declaration                                 //
 //****************************************************************************//

-  CAL3D_WRAPPER_API int CalCoreModel_AddCoreAnimation(CalCoreModel *self, CalCoreAnimation *pCoreAnimation);
-  CAL3D_WRAPPER_API int CalCoreModel_AddCoreMaterial(CalCoreModel *self, CalCoreMaterial *pCoreMaterial);
-  CAL3D_WRAPPER_API int CalCoreModel_AddCoreMesh(CalCoreModel *self, CalCoreMesh *pCoreMesh);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_Create(CalCoreModel *self, char *strName);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_CreateCoreMaterialThread(CalCoreModel *self, int coreMaterialThreadId);
-  CAL3D_WRAPPER_API void CalCoreModel_Delete(CalCoreModel *self);
-  CAL3D_WRAPPER_API void CalCoreModel_Destroy(CalCoreModel *self);
-  CAL3D_WRAPPER_API CalCoreAnimation *CalCoreModel_GetCoreAnimation(CalCoreModel *self, int coreAnimationId);
-  CAL3D_WRAPPER_API int CalCoreModel_GetCoreAnimationCount(CalCoreModel *self);
-  CAL3D_WRAPPER_API CalCoreMaterial *CalCoreModel_GetCoreMaterial(CalCoreModel *self, int coreMaterialId);
-  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMaterialCount(CalCoreModel *self);
-  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMaterialId(CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId);
-  CAL3D_WRAPPER_API CalCoreMesh *CalCoreModel_GetCoreMesh(CalCoreModel *self, int coreMeshId);
-  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMeshCount(CalCoreModel *self);
-  CAL3D_WRAPPER_API CalCoreSkeleton *CalCoreModel_GetCoreSkeleton(CalCoreModel *self);
-  CAL3D_WRAPPER_API CalUserData CalCoreModel_GetUserData(CalCoreModel *self);
-  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreAnimation(CalCoreModel *self, char *strFilename);
-  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMaterial(CalCoreModel *self, char *strFilename);
-  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMesh(CalCoreModel *self, char *strFilename);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_LoadCoreSkeleton(CalCoreModel *self, char *strFilename);
-  CAL3D_WRAPPER_API CalCoreModel *CalCoreModel_New();
-  CAL3D_WRAPPER_API Boolean CalCoreModel_SaveCoreAnimation(CalCoreModel *self, char *strFilename, int coreAnimtionId);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_SaveCoreMaterial(CalCoreModel *self, char *strFilename, int coreMaterialId);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_SaveCoreMesh(CalCoreModel *self, char *strFilename, int coreMeshId);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_SaveCoreSkeleton(CalCoreModel *self, char *strFilename);
-  CAL3D_WRAPPER_API Boolean CalCoreModel_SetCoreMaterialId(CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId);
-  CAL3D_WRAPPER_API void CalCoreModel_SetCoreSkeleton(CalCoreModel *self, CalCoreSkeleton *pCoreSkeleton);
-  CAL3D_WRAPPER_API void CalCoreModel_SetUserData(CalCoreModel *self, CalUserData userData);
+  CAL3D_WRAPPER_API int CalCoreModel_AddCoreAnimation(struct CalCoreModel *self, struct  CalCoreAnimation *pCoreAnimation);
+  CAL3D_WRAPPER_API int CalCoreModel_AddCoreMaterial(struct CalCoreModel *self, struct CalCoreMaterial *pCoreMaterial);
+  CAL3D_WRAPPER_API int CalCoreModel_AddCoreMesh(struct CalCoreModel *self, struct CalCoreMesh *pCoreMesh);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_Create(struct CalCoreModel *self, char *strName);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_CreateCoreMaterialThread(struct CalCoreModel *self, int coreMaterialThreadId);
+  CAL3D_WRAPPER_API void CalCoreModel_Delete(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API void CalCoreModel_Destroy(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreModel_GetCoreAnimation(struct CalCoreModel *self, int coreAnimationId);
+  CAL3D_WRAPPER_API int CalCoreModel_GetCoreAnimationCount(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreModel_GetCoreMaterial(struct CalCoreModel *self, int coreMaterialId);
+  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMaterialCount(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMaterialId(struct CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId);
+  CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreModel_GetCoreMesh(struct CalCoreModel *self, int coreMeshId);
+  CAL3D_WRAPPER_API int CalCoreModel_GetCoreMeshCount(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreModel_GetCoreSkeleton(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API CalUserData CalCoreModel_GetUserData(struct CalCoreModel *self);
+  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreAnimation(struct CalCoreModel *self, char *strFilename);
+  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMaterial(struct CalCoreModel *self, char *strFilename);
+  CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMesh(struct CalCoreModel *self, char *strFilename);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_LoadCoreSkeleton(struct CalCoreModel *self, char *strFilename);
+  CAL3D_WRAPPER_API struct CalCoreModel *CalCoreModel_New();
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreAnimation(struct CalCoreModel *self, char *strFilename, int coreAnimtionId);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreMaterial(struct CalCoreModel *self, char *strFilename, int coreMaterialId);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreMesh(struct CalCoreModel *self, char *strFilename, int coreMeshId);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreSkeleton(struct CalCoreModel *self, char *strFilename);
+  CAL3D_WRAPPER_API enum Boolean CalCoreModel_SetCoreMaterialId(struct CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId);
+  CAL3D_WRAPPER_API void CalCoreModel_SetCoreSkeleton(struct CalCoreModel *self, struct CalCoreSkeleton *pCoreSkeleton);
+  CAL3D_WRAPPER_API void CalCoreModel_SetUserData(struct CalCoreModel *self, CalUserData userData);

 //****************************************************************************//
 // CalCoreSkeleton wrapper functions declaration                              //
 //****************************************************************************//

-  CAL3D_WRAPPER_API int CalCoreSkeleton_AddCoreBone(CalCoreSkeleton *self, CalCoreBone *pCoreBone);
-  CAL3D_WRAPPER_API void CalCoreSkeleton_CalculateState(CalCoreSkeleton *self);
-  CAL3D_WRAPPER_API Boolean CalCoreSkeleton_Create(CalCoreSkeleton *self);
-  CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(CalCoreSkeleton *self);
-  CAL3D_WRAPPER_API void CalCoreSkeleton_Destroy(CalCoreSkeleton *self);
-  CAL3D_WRAPPER_API CalCoreBone *CalCoreSkeleton_GetCoreBone(CalCoreSkeleton *self, int coreBoneId);
-  CAL3D_WRAPPER_API int CalCoreSkeleton_GetCoreBoneId(CalCoreSkeleton *self, char *strName);
-//  CAL3D_WRAPPER_API std::list<int>& CalCoreSkeleton_GetListRootCoreBoneId(CalCoreSkeleton *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreBone *>& CalCoreSkeleton_GetVectorCoreBone(CalCoreSkeleton *self);
-  CAL3D_WRAPPER_API CalCoreSkeleton *CalCoreSkeleton_New();
+  CAL3D_WRAPPER_API int CalCoreSkeleton_AddCoreBone(struct CalCoreSkeleton *self, struct CalCoreBone *pCoreBone);
+  CAL3D_WRAPPER_API void CalCoreSkeleton_CalculateState(struct CalCoreSkeleton *self);
+  CAL3D_WRAPPER_API enum Boolean CalCoreSkeleton_Create(struct CalCoreSkeleton *self);
+  CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(struct CalCoreSkeleton *self);
+  CAL3D_WRAPPER_API void CalCoreSkeleton_Destroy(struct CalCoreSkeleton *self);
+  CAL3D_WRAPPER_API struct CalCoreBone *CalCoreSkeleton_GetCoreBone(struct CalCoreSkeleton *self, int coreBoneId);
+  CAL3D_WRAPPER_API int CalCoreSkeleton_GetCoreBoneId(struct CalCoreSkeleton *self, char *strName);
+//  CAL3D_WRAPPER_API std::list<int>& CalCoreSkeleton_GetListRootCoreBoneId(struct CalCoreSkeleton *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreBone *>& CalCoreSkeleton_GetVectorCoreBone(struct CalCoreSkeleton *self);
+  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreSkeleton_New();

 //****************************************************************************//
 // CalCoreSubmesh wrapper functions declaration                               //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_Create(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API void CalCoreSubmesh_Delete(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API void CalCoreSubmesh_Destroy(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API int CalCoreSubmesh_GetCoreMaterialThreadId(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API int CalCoreSubmesh_GetFaceCount(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API int CalCoreSubmesh_GetLodCount(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API int CalCoreSubmesh_GetSpringCount(CalCoreSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Face>& CalCoreSubmesh_GetVectorFace(CalCoreSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::PhysicalProperty>& CalCoreSubmesh_GetVectorPhysicalProperty(CalCoreSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Spring>& CalCoreSubmesh_GetVectorSpring(CalCoreSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<std::vector<CalCoreSubmesh::TextureCoordinate> >& CalCoreSubmesh_GetVectorVectorTextureCoordinate(CalCoreSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Vertex>& CalCoreSubmesh_GetVectorVertex(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API int CalCoreSubmesh_GetVertexCount(CalCoreSubmesh *self);
-  CAL3D_WRAPPER_API CalCoreSubmesh *CalCoreSubmesh_New();
-  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_Reserve(CalCoreSubmesh *self, int vertexCount, int textureCoordinateCount, int faceCount, int springCount);
-  CAL3D_WRAPPER_API void CalCoreSubmesh_SetCoreMaterialThreadId(CalCoreSubmesh *self, int coreMaterialThreadId);
-//  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_SetFace(CalCoreSubmesh *self, int faceId, CalCoreSubmesh::Face *pFace);
-  CAL3D_WRAPPER_API void CalCoreSubmesh_SetLodCount(CalCoreSubmesh *self, int lodCount);
-//  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_SetPhysicalProperty(CalCoreSubmesh *self, int vertexId, CalCoreSubmesh::PhysicalProperty *pPhysicalProperty);
-//  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_SetSpring(CalCoreSubmesh *self, int springId, CalCoreSubmesh::Spring *pSpring);
-//  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_SetTextureCoordinate(CalCoreSubmesh *self, int vertexId, int textureCoordinateId, CalCoreSubmesh::TextureCoordinate *pTextureCoordinate);
-//  CAL3D_WRAPPER_API Boolean CalCoreSubmesh_SetVertex(CalCoreSubmesh *self, int vertexId, CalCoreSubmesh::Vertex *pVertex);
+  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_Create(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API void CalCoreSubmesh_Delete(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API void CalCoreSubmesh_Destroy(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API int CalCoreSubmesh_GetCoreMaterialThreadId(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API int CalCoreSubmesh_GetFaceCount(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API int CalCoreSubmesh_GetLodCount(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API int CalCoreSubmesh_GetSpringCount(struct CalCoreSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Face>& CalCoreSubmesh_GetVectorFace(struct CalCoreSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::PhysicalProperty>& CalCoreSubmesh_GetVectorPhysicalProperty(struct CalCoreSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Spring>& CalCoreSubmesh_GetVectorSpring(struct CalCoreSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<std::vector<CalCoreSubmesh::TextureCoordinate> >& CalCoreSubmesh_GetVectorVectorTextureCoordinate(struct CalCoreSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Vertex>& CalCoreSubmesh_GetVectorVertex(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API int CalCoreSubmesh_GetVertexCount(struct CalCoreSubmesh *self);
+  CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreSubmesh_New();
+  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_Reserve(struct CalCoreSubmesh *self, int vertexCount, int textureCoordinateCount, int faceCount, int springCount);
+  CAL3D_WRAPPER_API void CalCoreSubmesh_SetCoreMaterialThreadId(struct CalCoreSubmesh *self, int coreMaterialThreadId);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetFace(struct CalCoreSubmesh *self, int faceId, struct CalCoreSubmesh::Face *pFace);
+  CAL3D_WRAPPER_API void CalCoreSubmesh_SetLodCount(struct CalCoreSubmesh *self, int lodCount);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetPhysicalProperty(struct CalCoreSubmesh *self, int vertexId, struct CalCoreSubmesh::PhysicalProperty *pPhysicalProperty);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetSpring(struct CalCoreSubmesh *self, int springId, struct CalCoreSubmesh::Spring *pSpring);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetTextureCoordinate(struct CalCoreSubmesh *self, int vertexId, int textureCoordinateId, struct CalCoreSubmesh::TextureCoordinate *pTextureCoordinate);
+//  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetVertex(struct CalCoreSubmesh *self, int vertexId, struct CalCoreSubmesh::Vertex *pVertex);

 //****************************************************************************//
 // CalCoreTrack wrapper functions declaration                                 //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalCoreTrack_AddCoreKeyframe(CalCoreTrack *self, CalCoreKeyframe *pCoreKeyframe);
-  CAL3D_WRAPPER_API Boolean CalCoreTrack_Create(CalCoreTrack *self);
-  CAL3D_WRAPPER_API void CalCoreTrack_Delete(CalCoreTrack *self);
-  CAL3D_WRAPPER_API void CalCoreTrack_Destroy(CalCoreTrack *self);
-  CAL3D_WRAPPER_API int CalCoreTrack_GetCoreBoneId(CalCoreTrack *self);
-//  CAL3D_WRAPPER_API std::map<float, CalCoreKeyframe *>& CalCoreTrack_GetMapCoreKeyframe(CalCoreTrack *self);
-  CAL3D_WRAPPER_API Boolean CalCoreTrack_GetState(CalCoreTrack *self, float time, CalVector *pTranslation, CalQuaternion *pRotation);
-  CAL3D_WRAPPER_API CalCoreTrack *CalCoreTrack_New();
-  CAL3D_WRAPPER_API Boolean CalCoreTrack_SetCoreBoneId(CalCoreTrack *self, int coreBoneId);
+  CAL3D_WRAPPER_API enum Boolean CalCoreTrack_AddCoreKeyframe(struct CalCoreTrack *self, struct CalCoreKeyframe *pCoreKeyframe);
+  CAL3D_WRAPPER_API enum Boolean CalCoreTrack_Create(struct CalCoreTrack *self);
+  CAL3D_WRAPPER_API void CalCoreTrack_Delete(struct CalCoreTrack *self);
+  CAL3D_WRAPPER_API void CalCoreTrack_Destroy(struct CalCoreTrack *self);
+  CAL3D_WRAPPER_API int CalCoreTrack_GetCoreBoneId(struct CalCoreTrack *self);
+//  CAL3D_WRAPPER_API std::map<float, CalCoreKeyframe *>& CalCoreTrack_GetMapCoreKeyframe(struct CalCoreTrack *self);
+  CAL3D_WRAPPER_API enum Boolean CalCoreTrack_GetState(struct CalCoreTrack *self, float time, struct CalVector *pTranslation, struct CalQuaternion *pRotation);
+  CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreTrack_New();
+  CAL3D_WRAPPER_API enum Boolean CalCoreTrack_SetCoreBoneId(struct CalCoreTrack *self, int coreBoneId);

 //****************************************************************************//
 // CalError wrapper functions declaration                                     //
@@ -391,92 +394,92 @@
     ERROR_CODE_MAX_ERROR_CODE
   };

-  CAL3D_WRAPPER_API CalErrorCode CalError_GetLastErrorCode();
+  CAL3D_WRAPPER_API enum CalErrorCode CalError_GetLastErrorCode();
   CAL3D_WRAPPER_API char *CalError_GetLastErrorDescription();
   CAL3D_WRAPPER_API char *CalError_GetLastErrorFile();
   CAL3D_WRAPPER_API int CalError_GetLastErrorLine();
   CAL3D_WRAPPER_API char *CalError_GetLastErrorText();
   CAL3D_WRAPPER_API void CalError_PrintLastError();
-  CAL3D_WRAPPER_API void CalError_SetLastError(CalErrorCode code, char *strFile, int line, char *strText);
+//  CAL3D_WRAPPER_API void CalError_SetLastError(enum CalErrorCode code, char *strFile, int line, char *strText);

 //****************************************************************************//
 // CalLoader wrapper functions declaration                                    //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalLoader_Delete(CalLoader *self);
-  CAL3D_WRAPPER_API CalCoreAnimation *CalLoader_LoadCoreAnimation(CalLoader *self, char *strFilename);
-  CAL3D_WRAPPER_API CalCoreMaterial *CalLoader_LoadCoreMaterial(CalLoader *self, char *strFilename);
-  CAL3D_WRAPPER_API CalCoreMesh *CalLoader_LoadCoreMesh(CalLoader *self, char *strFilename);
-  CAL3D_WRAPPER_API CalCoreSkeleton *CalLoader_LoadCoreSkeleton(CalLoader *self, char *strFilename);
-  CAL3D_WRAPPER_API CalLoader *CalLoader_New();
+  CAL3D_WRAPPER_API void CalLoader_Delete(struct CalLoader *self);
+  CAL3D_WRAPPER_API struct CalCoreAnimation *CalLoader_LoadCoreAnimation(struct CalLoader *self, char *strFilename);
+  CAL3D_WRAPPER_API struct CalCoreMaterial *CalLoader_LoadCoreMaterial(struct CalLoader *self, char *strFilename);
+  CAL3D_WRAPPER_API struct CalCoreMesh *CalLoader_LoadCoreMesh(struct CalLoader *self, char *strFilename);
+  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalLoader_LoadCoreSkeleton(struct CalLoader *self, char *strFilename);
+  CAL3D_WRAPPER_API struct CalLoader *CalLoader_New();

 //****************************************************************************//
 // CalMesh wrapper functions declaration                                      //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalMesh_Create(CalMesh *self, CalCoreMesh *pCoreMesh);
-  CAL3D_WRAPPER_API void CalMesh_Delete(CalMesh *self);
-  CAL3D_WRAPPER_API void CalMesh_Destroy(CalMesh *self);
-  CAL3D_WRAPPER_API CalCoreMesh *CalMesh_GetCoreMesh(CalMesh *self);
-  CAL3D_WRAPPER_API CalSubmesh *CalMesh_GetSubmesh(CalMesh *self, int id);
-  CAL3D_WRAPPER_API int CalMesh_GetSubmeshCount(CalMesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalSubmesh *>& CalMesh_GetVectorSubmesh(CalMesh *self);
-  CAL3D_WRAPPER_API CalMesh *CalMesh_New();
-  CAL3D_WRAPPER_API void CalMesh_SetLodLevel(CalMesh *self, float lodLevel);
-  CAL3D_WRAPPER_API void CalMesh_SetMaterialSet(CalMesh *self, int setId);
-  CAL3D_WRAPPER_API void CalMesh_SetModel(CalMesh *self, CalModel *pModel);
+  CAL3D_WRAPPER_API enum Boolean CalMesh_Create(struct CalMesh *self, struct CalCoreMesh *pCoreMesh);
+  CAL3D_WRAPPER_API void CalMesh_Delete(struct CalMesh *self);
+  CAL3D_WRAPPER_API void CalMesh_Destroy(struct CalMesh *self);
+  CAL3D_WRAPPER_API struct CalCoreMesh *CalMesh_GetCoreMesh(struct CalMesh *self);
+  CAL3D_WRAPPER_API struct CalSubmesh *CalMesh_GetSubmesh(struct CalMesh *self, int id);
+  CAL3D_WRAPPER_API int CalMesh_GetSubmeshCount(struct CalMesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalSubmesh *>& CalMesh_GetVectorSubmesh(struct CalMesh *self);
+  CAL3D_WRAPPER_API struct CalMesh *CalMesh_New();
+  CAL3D_WRAPPER_API void CalMesh_SetLodLevel(struct CalMesh *self, float lodLevel);
+  CAL3D_WRAPPER_API void CalMesh_SetMaterialSet(struct CalMesh *self, int setId);
+  CAL3D_WRAPPER_API void CalMesh_SetModel(struct CalMesh *self, struct CalModel *pModel);

 //****************************************************************************//
 // CalMixer wrapper functions declaration                                     //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalMixer_BlendCycle(CalMixer *self, int id, float weight, float delay);
-  CAL3D_WRAPPER_API Boolean CalMixer_ClearCycle(CalMixer *self, int id, float delay);
-  CAL3D_WRAPPER_API Boolean CalMixer_Create(CalMixer *self, CalModel *pModel);
-  CAL3D_WRAPPER_API void CalMixer_Delete(CalMixer *self);
-  CAL3D_WRAPPER_API void CalMixer_Destroy(CalMixer *self);
-  CAL3D_WRAPPER_API Boolean CalMixer_ExecuteAction(CalMixer *self, int id, float delayIn, float delayOut);
-  CAL3D_WRAPPER_API CalMixer *CalMixer_New();
-  CAL3D_WRAPPER_API void CalMixer_UpdateAnimation(CalMixer *self, float deltaTime);
-  CAL3D_WRAPPER_API void CalMixer_UpdateSkeleton(CalMixer *self);
+  CAL3D_WRAPPER_API enum Boolean CalMixer_BlendCycle(struct CalMixer *self, int id, float weight, float delay);
+  CAL3D_WRAPPER_API enum Boolean CalMixer_ClearCycle(struct CalMixer *self, int id, float delay);
+  CAL3D_WRAPPER_API enum Boolean CalMixer_Create(struct CalMixer *self, struct CalModel *pModel);
+  CAL3D_WRAPPER_API void CalMixer_Delete(struct CalMixer *self);
+  CAL3D_WRAPPER_API void CalMixer_Destroy(struct CalMixer *self);
+  CAL3D_WRAPPER_API enum Boolean CalMixer_ExecuteAction(struct CalMixer *self, int id, float delayIn, float delayOut);
+  CAL3D_WRAPPER_API struct CalMixer *CalMixer_New();
+  CAL3D_WRAPPER_API void CalMixer_UpdateAnimation(struct CalMixer *self, float deltaTime);
+  CAL3D_WRAPPER_API void CalMixer_UpdateSkeleton(struct CalMixer *self);

 //****************************************************************************//
 // CalModel wrapper functions declaration                                     //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalModel_AttachMesh(CalModel *self, int coreMeshId);
-  CAL3D_WRAPPER_API Boolean CalModel_Create(CalModel *self, CalCoreModel *pCoreModel);
-  CAL3D_WRAPPER_API void CalModel_Delete(CalModel *self);
-  CAL3D_WRAPPER_API void CalModel_Destroy(CalModel *self);
-  CAL3D_WRAPPER_API Boolean CalModel_DetachMesh(CalModel *self, int coreMeshId);
-  CAL3D_WRAPPER_API CalCoreModel *CalModel_GetCoreModel(CalModel *self);
-  CAL3D_WRAPPER_API CalMesh *CalModel_GetMesh(CalModel *self, int coreMeshId);
-  CAL3D_WRAPPER_API CalMixer *CalModel_GetMixer(CalModel *self);
-  CAL3D_WRAPPER_API CalPhysique *CalModel_GetPhysique(CalModel *self);
-  CAL3D_WRAPPER_API CalRenderer *CalModel_GetRenderer(CalModel *self);
-  CAL3D_WRAPPER_API CalSkeleton *CalModel_GetSkeleton(CalModel *self);
-  CAL3D_WRAPPER_API CalSpringSystem *CalModel_GetSpringSystem(CalModel *self);
-  CAL3D_WRAPPER_API CalUserData CalModel_GetUserData(CalModel *self);
-//  CAL3D_WRAPPER_API std::vector<CalMesh *>& CalModel_GetVectorMesh(CalModel *self);
-  CAL3D_WRAPPER_API CalModel *CalModel_New();
-  CAL3D_WRAPPER_API void CalModel_SetLodLevel(CalModel *self, float lodLevel);
-  CAL3D_WRAPPER_API void CalModel_SetMaterialSet(CalModel *self, int setId);
-  CAL3D_WRAPPER_API void CalModel_SetUserData(CalModel *self, CalUserData userData);
-  CAL3D_WRAPPER_API void CalModel_Update(CalModel *self, float deltaTime);
+  CAL3D_WRAPPER_API enum Boolean CalModel_AttachMesh(struct CalModel *self, int coreMeshId);
+  CAL3D_WRAPPER_API enum Boolean CalModel_Create(struct CalModel *self, struct CalCoreModel *pCoreModel);
+  CAL3D_WRAPPER_API void CalModel_Delete(struct CalModel *self);
+  CAL3D_WRAPPER_API void CalModel_Destroy(struct CalModel *self);
+  CAL3D_WRAPPER_API enum Boolean CalModel_DetachMesh(struct CalModel *self, int coreMeshId);
+  CAL3D_WRAPPER_API struct CalCoreModel *CalModel_GetCoreModel(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalMesh *CalModel_GetMesh(struct CalModel *self, int coreMeshId);
+  CAL3D_WRAPPER_API struct CalMixer *CalModel_GetMixer(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalPhysique *CalModel_GetPhysique(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalRenderer *CalModel_GetRenderer(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalSkeleton *CalModel_GetSkeleton(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalSpringSystem *CalModel_GetSpringSystem(struct CalModel *self);
+  CAL3D_WRAPPER_API CalUserData CalModel_GetUserData(struct CalModel *self);
+//  CAL3D_WRAPPER_API std::vector<CalMesh *>& CalModel_GetVectorMesh(struct CalModel *self);
+  CAL3D_WRAPPER_API struct CalModel *CalModel_New();
+  CAL3D_WRAPPER_API void CalModel_SetLodLevel(struct CalModel *self, float lodLevel);
+  CAL3D_WRAPPER_API void CalModel_SetMaterialSet(struct CalModel *self, int setId);
+  CAL3D_WRAPPER_API void CalModel_SetUserData(struct CalModel *self, CalUserData userData);
+  CAL3D_WRAPPER_API void CalModel_Update(struct CalModel *self, float deltaTime);

 //****************************************************************************//
 // CalPhysique wrapper functions declaration                                  //
 //****************************************************************************//

-  CAL3D_WRAPPER_API int CalPhysique_CalculateNormals(CalPhysique *self, CalSubmesh *pSubmesh, float *pNormalBuffer);
-  CAL3D_WRAPPER_API int CalPhysique_CalculateVertices(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer);
-  CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesAndNormals(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer);
-  CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesNormalsAndTexCoords(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer, int NumTexCoords);
-  CAL3D_WRAPPER_API Boolean CalPhysique_Create(CalPhysique *self, CalModel *pModel);
-  CAL3D_WRAPPER_API void CalPhysique_Delete(CalPhysique *self);
-  CAL3D_WRAPPER_API void CalPhysique_Destroy(CalPhysique *self);
-  CAL3D_WRAPPER_API CalPhysique *CalPhysique_New();
-  CAL3D_WRAPPER_API void CalPhysique_Update(CalPhysique *self);
+  CAL3D_WRAPPER_API int CalPhysique_CalculateNormals(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pNormalBuffer);
+  CAL3D_WRAPPER_API int CalPhysique_CalculateVertices(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pVertexBuffer);
+  CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesAndNormals(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pVertexBuffer);
+  CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesNormalsAndTexCoords(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pVertexBuffer, int NumTexCoords);
+  CAL3D_WRAPPER_API enum Boolean CalPhysique_Create(struct CalPhysique *self, struct CalModel *pModel);
+  CAL3D_WRAPPER_API void CalPhysique_Delete(struct CalPhysique *self);
+  CAL3D_WRAPPER_API void CalPhysique_Destroy(struct CalPhysique *self);
+  CAL3D_WRAPPER_API struct CalPhysique *CalPhysique_New();
+  CAL3D_WRAPPER_API void CalPhysique_Update(struct CalPhysique *self);

 //****************************************************************************//
 // CalPlatform wrapper functions declaration                                  //
@@ -486,135 +489,135 @@
 // CalQuaternion wrapper functions declaration                                //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalQuaternion_Blend(CalQuaternion *self, float d, CalQuaternion *pQ);
-  CAL3D_WRAPPER_API void CalQuaternion_Clear(CalQuaternion *self);
-  CAL3D_WRAPPER_API void CalQuaternion_Conjugate(CalQuaternion *self);
-  CAL3D_WRAPPER_API void CalQuaternion_Delete(CalQuaternion *self);
-  CAL3D_WRAPPER_API void CalQuaternion_Equal(CalQuaternion *self, CalQuaternion *pQ);
-  CAL3D_WRAPPER_API float *CalQuaternion_Get(CalQuaternion *self);
-  CAL3D_WRAPPER_API void CalQuaternion_Multiply(CalQuaternion *self, CalQuaternion *pQ);
-  CAL3D_WRAPPER_API void CalQuaternion_MultiplyVector(CalQuaternion *self, CalVector *pV);
-  CAL3D_WRAPPER_API CalQuaternion *CalQuaternion_New();
-  CAL3D_WRAPPER_API void CalQuaternion_Op_Multiply(CalQuaternion *pResult, CalQuaternion *pQ, CalQuaternion *pR);
-  CAL3D_WRAPPER_API void CalQuaternion_Set(CalQuaternion *self, float qx, float qy, float qz, float qw);
+  CAL3D_WRAPPER_API void CalQuaternion_Blend(struct CalQuaternion *self, float d, struct CalQuaternion *pQ);
+  CAL3D_WRAPPER_API void CalQuaternion_Clear(struct CalQuaternion *self);
+  CAL3D_WRAPPER_API void CalQuaternion_Conjugate(struct CalQuaternion *self);
+  CAL3D_WRAPPER_API void CalQuaternion_Delete(struct CalQuaternion *self);
+  CAL3D_WRAPPER_API void CalQuaternion_Equal(struct CalQuaternion *self, struct CalQuaternion *pQ);
+  CAL3D_WRAPPER_API float *CalQuaternion_Get(struct CalQuaternion *self);
+  CAL3D_WRAPPER_API void CalQuaternion_Multiply(struct CalQuaternion *self, struct CalQuaternion *pQ);
+  CAL3D_WRAPPER_API void CalQuaternion_MultiplyVector(struct CalQuaternion *self, struct CalVector *pV);
+  CAL3D_WRAPPER_API struct CalQuaternion *CalQuaternion_New();
+  CAL3D_WRAPPER_API void CalQuaternion_Op_Multiply(struct CalQuaternion *pResult, struct CalQuaternion *pQ, struct CalQuaternion *pR);
+  CAL3D_WRAPPER_API void CalQuaternion_Set(struct CalQuaternion *self, float qx, float qy, float qz, float qw);

 //****************************************************************************//
 // CalRenderer wrapper functions declaration                                  //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalRenderer_BeginRendering(CalRenderer *self);
-  CAL3D_WRAPPER_API Boolean CalRenderer_Create(CalRenderer *self, CalModel *pModel);
-  CAL3D_WRAPPER_API void CalRenderer_Delete(CalRenderer *self);
-  CAL3D_WRAPPER_API void CalRenderer_Destroy(CalRenderer *self);
-  CAL3D_WRAPPER_API void CalRenderer_EndRendering(CalRenderer *self);
-  CAL3D_WRAPPER_API void CalRenderer_GetAmbientColor(CalRenderer *self, unsigned char *pColorBuffer);
-  CAL3D_WRAPPER_API void CalRenderer_GetDiffuseColor(CalRenderer *self, unsigned char *pColorBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetFaceCount(CalRenderer *self);
-  CAL3D_WRAPPER_API int CalRenderer_GetFaces(CalRenderer *self, CalIndex *pFaceBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetMapCount(CalRenderer *self);
-  CAL3D_WRAPPER_API CalUserData CalRenderer_GetMapUserData(CalRenderer *self, int mapId);
-  CAL3D_WRAPPER_API int CalRenderer_GetMeshCount(CalRenderer *self);
-  CAL3D_WRAPPER_API int CalRenderer_GetNormals(CalRenderer *self, float *pNormalBuffer);
-  CAL3D_WRAPPER_API float CalRenderer_GetShininess(CalRenderer *self);
-  CAL3D_WRAPPER_API void CalRenderer_GetSpecularColor(CalRenderer *self, unsigned char *pColorBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetSubmeshCount(CalRenderer *self, int meshId);
-  CAL3D_WRAPPER_API int CalRenderer_GetTextureCoordinates(CalRenderer *self, int mapId, float *pTextureCoordinateBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetVertexCount(CalRenderer *self);
-  CAL3D_WRAPPER_API int CalRenderer_GetVertices(CalRenderer *self, float *pVertexBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetVerticesAndNormals(CalRenderer *self, float *pVertexBuffer);
-  CAL3D_WRAPPER_API int CalRenderer_GetVerticesNormalsAndTexCoords(CalRenderer *self, float *pVertexBuffer, int NumTexCoords);
-  CAL3D_WRAPPER_API CalRenderer *CalRenderer_New();
-  CAL3D_WRAPPER_API Boolean CalRenderer_SelectMeshSubmesh(CalRenderer *self, int meshId, int submeshId);
+  CAL3D_WRAPPER_API enum Boolean CalRenderer_BeginRendering(struct CalRenderer *self);
+  CAL3D_WRAPPER_API enum Boolean CalRenderer_Create(struct CalRenderer *self, struct CalModel *pModel);
+  CAL3D_WRAPPER_API void CalRenderer_Delete(struct CalRenderer *self);
+  CAL3D_WRAPPER_API void CalRenderer_Destroy(struct CalRenderer *self);
+  CAL3D_WRAPPER_API void CalRenderer_EndRendering(struct CalRenderer *self);
+  CAL3D_WRAPPER_API void CalRenderer_GetAmbientColor(struct CalRenderer *self, unsigned char *pColorBuffer);
+  CAL3D_WRAPPER_API void CalRenderer_GetDiffuseColor(struct CalRenderer *self, unsigned char *pColorBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetFaceCount(struct CalRenderer *self);
+  CAL3D_WRAPPER_API int CalRenderer_GetFaces(struct CalRenderer *self, CalIndex *pFaceBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetMapCount(struct CalRenderer *self);
+  CAL3D_WRAPPER_API CalUserData CalRenderer_GetMapUserData(struct CalRenderer *self, int mapId);
+  CAL3D_WRAPPER_API int CalRenderer_GetMeshCount(struct CalRenderer *self);
+  CAL3D_WRAPPER_API int CalRenderer_GetNormals(struct CalRenderer *self, float *pNormalBuffer);
+  CAL3D_WRAPPER_API float CalRenderer_GetShininess(struct CalRenderer *self);
+  CAL3D_WRAPPER_API void CalRenderer_GetSpecularColor(struct CalRenderer *self, unsigned char *pColorBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetSubmeshCount(struct CalRenderer *self, int meshId);
+  CAL3D_WRAPPER_API int CalRenderer_GetTextureCoordinates(struct CalRenderer *self, int mapId, float *pTextureCoordinateBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetVertexCount(struct CalRenderer *self);
+  CAL3D_WRAPPER_API int CalRenderer_GetVertices(struct CalRenderer *self, float *pVertexBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetVerticesAndNormals(struct CalRenderer *self, float *pVertexBuffer);
+  CAL3D_WRAPPER_API int CalRenderer_GetVerticesNormalsAndTexCoords(struct CalRenderer *self, float *pVertexBuffer, int NumTexCoords);
+  CAL3D_WRAPPER_API struct CalRenderer *CalRenderer_New();
+  CAL3D_WRAPPER_API enum Boolean CalRenderer_SelectMeshSubmesh(struct CalRenderer *self, int meshId, int submeshId);

 //****************************************************************************//
 // CalSaver wrapper functions declaration                                     //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalSaver_Delete(CalSaver *self);
-  CAL3D_WRAPPER_API CalSaver *CalSaver_New();
-  CAL3D_WRAPPER_API Boolean CalSaver_SaveCoreAnimation(CalSaver *self, char *strFilename, CalCoreAnimation *pCoreAnimation);
-  CAL3D_WRAPPER_API Boolean CalSaver_SaveCoreMaterial(CalSaver *self, char *strFilename, CalCoreMaterial *pCoreMaterial);
-  CAL3D_WRAPPER_API Boolean CalSaver_SaveCoreMesh(CalSaver *self, char *strFilename, CalCoreMesh *pCoreMesh);
-  CAL3D_WRAPPER_API Boolean CalSaver_SaveCoreSkeleton(CalSaver *self, char *strFilename, CalCoreSkeleton *pCoreSkeleton);
+  CAL3D_WRAPPER_API void CalSaver_Delete(struct CalSaver *self);
+  CAL3D_WRAPPER_API struct CalSaver *CalSaver_New();
+  CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreAnimation(struct CalSaver *self, char *strFilename, struct  CalCoreAnimation *pCoreAnimation);
+  CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMaterial(struct CalSaver *self, char *strFilename, struct CalCoreMaterial *pCoreMaterial);
+  CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMesh(struct CalSaver *self, char *strFilename, struct CalCoreMesh *pCoreMesh);
+  CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreSkeleton(struct CalSaver *self, char *strFilename, struct CalCoreSkeleton *pCoreSkeleton);

 //****************************************************************************//
 // CalSkeleton wrapper functions declaration                                  //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalSkeleton_CalculateState(CalSkeleton *self);
-  CAL3D_WRAPPER_API void CalSkeleton_ClearState(CalSkeleton *self);
-  CAL3D_WRAPPER_API Boolean CalSkeleton_Create(CalSkeleton *self, CalCoreSkeleton *pCoreSkeleton);
-  CAL3D_WRAPPER_API void CalSkeleton_Delete(CalSkeleton *self);
-  CAL3D_WRAPPER_API void CalSkeleton_Destroy(CalSkeleton *self);
-  CAL3D_WRAPPER_API CalBone *CalSkeleton_GetBone(CalSkeleton *self, int boneId);
-  CAL3D_WRAPPER_API CalCoreSkeleton *CalSkeleton_GetCoreSkeleton(CalSkeleton *self);
-//  CAL3D_WRAPPER_API std::vector<CalBone *>& CalSkeleton_GetVectorBone(CalSkeleton *self);
-  CAL3D_WRAPPER_API void CalSkeleton_LockState(CalSkeleton *self);
-  CAL3D_WRAPPER_API CalSkeleton *CalSkeleton_New();
+  CAL3D_WRAPPER_API void CalSkeleton_CalculateState(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API void CalSkeleton_ClearState(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API enum Boolean CalSkeleton_Create(struct CalSkeleton *self, struct CalCoreSkeleton *pCoreSkeleton);
+  CAL3D_WRAPPER_API void CalSkeleton_Delete(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API void CalSkeleton_Destroy(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API struct CalBone *CalSkeleton_GetBone(struct CalSkeleton *self, int boneId);
+  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalSkeleton_GetCoreSkeleton(struct CalSkeleton *self);
+//  CAL3D_WRAPPER_API std::vector<CalBone *>& CalSkeleton_GetVectorBone(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API void CalSkeleton_LockState(struct CalSkeleton *self);
+  CAL3D_WRAPPER_API struct CalSkeleton *CalSkeleton_New();

   // DEBUG-CODE
-  CAL3D_WRAPPER_API int CalSkeleton_GetBonePoints(CalSkeleton *self, float *pPoints);
-  CAL3D_WRAPPER_API int CalSkeleton_GetBonePointsStatic(CalSkeleton *self, float *pPoints);
-  CAL3D_WRAPPER_API int CalSkeleton_GetBoneLines(CalSkeleton *self, float *pLines);
-  CAL3D_WRAPPER_API int CalSkeleton_GetBoneLinesStatic(CalSkeleton *self, float *pLines);
+  CAL3D_WRAPPER_API int CalSkeleton_GetBonePoints(struct CalSkeleton *self, float *pPoints);
+  CAL3D_WRAPPER_API int CalSkeleton_GetBonePointsStatic(struct CalSkeleton *self, float *pPoints);
+  CAL3D_WRAPPER_API int CalSkeleton_GetBoneLines(struct CalSkeleton *self, float *pLines);
+  CAL3D_WRAPPER_API int CalSkeleton_GetBoneLinesStatic(struct CalSkeleton *self, float *pLines);

 //****************************************************************************//
 // CalSpringSystem wrapper functions declaration                              //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalSpringSystem_CalculateForces(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime);
-  CAL3D_WRAPPER_API void CalSpringSystem_CalculateVertices(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime);
-  CAL3D_WRAPPER_API Boolean CalSpringSystem_Create(CalSpringSystem *self, CalModel *pModel);
-  CAL3D_WRAPPER_API void CalSpringSystem_Delete(CalSpringSystem *self);
-  CAL3D_WRAPPER_API void CalSpringSystem_Destroy(CalSpringSystem *self);
-  CAL3D_WRAPPER_API CalSpringSystem *CalSpringSystem_New();
-  CAL3D_WRAPPER_API void CalSpringSystem_Update(CalSpringSystem *self, float deltaTime);
+  CAL3D_WRAPPER_API void CalSpringSystem_CalculateForces(struct CalSpringSystem *self, struct CalSubmesh *pSubmesh, float deltaTime);
+  CAL3D_WRAPPER_API void CalSpringSystem_CalculateVertices(struct CalSpringSystem *self, struct CalSubmesh *pSubmesh, float deltaTime);
+  CAL3D_WRAPPER_API enum Boolean CalSpringSystem_Create(struct CalSpringSystem *self, struct CalModel *pModel);
+  CAL3D_WRAPPER_API void CalSpringSystem_Delete(struct CalSpringSystem *self);
+  CAL3D_WRAPPER_API void CalSpringSystem_Destroy(struct CalSpringSystem *self);
+  CAL3D_WRAPPER_API struct CalSpringSystem *CalSpringSystem_New();
+  CAL3D_WRAPPER_API void CalSpringSystem_Update(struct CalSpringSystem *self, float deltaTime);

 //****************************************************************************//
 // CalSubmesh wrapper functions declaration                                   //
 //****************************************************************************//

-  CAL3D_WRAPPER_API Boolean CalSubmesh_Create(CalSubmesh *self, CalCoreSubmesh *pCoreSubmesh);
-  CAL3D_WRAPPER_API void CalSubmesh_Delete(CalSubmesh *self);
-  CAL3D_WRAPPER_API void CalSubmesh_Destroy(CalSubmesh *self);
-  CAL3D_WRAPPER_API CalCoreSubmesh *CalSubmesh_GetCoreSubmesh(CalSubmesh *self);
-  CAL3D_WRAPPER_API int CalSubmesh_GetCoreMaterialId(CalSubmesh *self);
-  CAL3D_WRAPPER_API int CalSubmesh_GetFaceCount(CalSubmesh *self);
-  CAL3D_WRAPPER_API int CalSubmesh_GetFaces(CalSubmesh *self, CalIndex *pFaceBuffer);
-
-//  CAL3D_WRAPPER_API std::vector<CalVector>& CalSubmesh_GetVectorNormal(CalSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalSubmesh::PhysicalProperty>& CalSubmesh_GetVectorPhysicalProperty(CalSubmesh *self);
-//  CAL3D_WRAPPER_API std::vector<CalVector>& CalSubmesh_GetVectorVertex(CalSubmesh *self);
-  CAL3D_WRAPPER_API int CalSubmesh_GetVertexCount(CalSubmesh *self);
-  CAL3D_WRAPPER_API Boolean CalSubmesh_HasInternalData(CalSubmesh *self);
-  CAL3D_WRAPPER_API CalSubmesh *CalSubmesh_New();
-  CAL3D_WRAPPER_API void CalSubmesh_SetCoreMaterialId(CalSubmesh *self, int coreMaterialId);
-  CAL3D_WRAPPER_API void CalSubmesh_SetLodLevel(CalSubmesh *self, float lodLevel);
+  CAL3D_WRAPPER_API enum Boolean CalSubmesh_Create(struct CalSubmesh *self, struct CalCoreSubmesh *pCoreSubmesh);
+  CAL3D_WRAPPER_API void CalSubmesh_Delete(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API void CalSubmesh_Destroy(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API struct CalCoreSubmesh *CalSubmesh_GetCoreSubmesh(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API int CalSubmesh_GetCoreMaterialId(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API int CalSubmesh_GetFaceCount(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API int CalSubmesh_GetFaces(struct CalSubmesh *self, CalIndex *pFaceBuffer);
+
+//  CAL3D_WRAPPER_API std::vector<CalVector>& CalSubmesh_GetVectorNormal(struct CalSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalSubmesh::PhysicalProperty>& CalSubmesh_GetVectorPhysicalProperty(struct CalSubmesh *self);
+//  CAL3D_WRAPPER_API std::vector<CalVector>& CalSubmesh_GetVectorVertex(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API int CalSubmesh_GetVertexCount(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API enum Boolean CalSubmesh_HasInternalData(struct CalSubmesh *self);
+  CAL3D_WRAPPER_API struct CalSubmesh *CalSubmesh_New();
+  CAL3D_WRAPPER_API void CalSubmesh_SetCoreMaterialId(struct CalSubmesh *self, int coreMaterialId);
+  CAL3D_WRAPPER_API void CalSubmesh_SetLodLevel(struct CalSubmesh *self, float lodLevel);

 //****************************************************************************//
 // CalVector wrapper functions declaration                                    //
 //****************************************************************************//

-  CAL3D_WRAPPER_API void CalVector_Add(CalVector *self, CalVector *pV);
-  CAL3D_WRAPPER_API void CalVector_Blend(CalVector *self, float d, CalVector *pV);
-  CAL3D_WRAPPER_API void CalVector_Clear(CalVector *self);
-  CAL3D_WRAPPER_API void CalVector_Delete(CalVector *self);
-  CAL3D_WRAPPER_API void CalVector_Equal(CalVector *self, CalVector *pV);
-  CAL3D_WRAPPER_API void CalVector_InverseScale(CalVector *self, float d);
-  CAL3D_WRAPPER_API float *CalVector_Get(CalVector *self);
-  CAL3D_WRAPPER_API float CalVector_Length(CalVector *self);
-  CAL3D_WRAPPER_API CalVector *CalVector_New();
-  CAL3D_WRAPPER_API float CalVector_Normalize(CalVector *self);
-  CAL3D_WRAPPER_API void CalVector_Op_Add(CalVector *pResult, CalVector *pV, CalVector *pU);
-  CAL3D_WRAPPER_API void CalVector_Op_Subtract(CalVector *pResult, CalVector *pV, CalVector *pU);
-  CAL3D_WRAPPER_API void CalVector_CalVector_Op_Scale(CalVector *pResult, CalVector *pV, float d);
-  CAL3D_WRAPPER_API void CalVector_CalVector_Op_InverseScale(CalVector *pResult, CalVector *pV, float d);
-  CAL3D_WRAPPER_API float CalVector_Op_Scalar(CalVector *pV, CalVector *pU);
-  CAL3D_WRAPPER_API void CalVector_Op_Cross(CalVector *pResult, CalVector *pV, CalVector *pU);
-  CAL3D_WRAPPER_API void CalVector_Scale(CalVector *self, float d);
-  CAL3D_WRAPPER_API void CalVector_Set(CalVector *self, float vx, float vy, float vz);
-  CAL3D_WRAPPER_API void CalVector_Subtract(CalVector *self, CalVector *pV);
-  CAL3D_WRAPPER_API void CalVector_Transform(CalVector *self, CalQuaternion *pQ);
+  CAL3D_WRAPPER_API void CalVector_Add(struct CalVector *self, struct CalVector *pV);
+  CAL3D_WRAPPER_API void CalVector_Blend(struct CalVector *self, float d, struct CalVector *pV);
+  CAL3D_WRAPPER_API void CalVector_Clear(struct CalVector *self);
+  CAL3D_WRAPPER_API void CalVector_Delete(struct CalVector *self);
+  CAL3D_WRAPPER_API void CalVector_Equal(struct CalVector *self, struct CalVector *pV);
+  CAL3D_WRAPPER_API void CalVector_InverseScale(struct CalVector *self, float d);
+  CAL3D_WRAPPER_API float *CalVector_Get(struct CalVector *self);
+  CAL3D_WRAPPER_API float CalVector_Length(struct CalVector *self);
+  CAL3D_WRAPPER_API struct CalVector *CalVector_New();
+  CAL3D_WRAPPER_API float CalVector_Normalize(struct CalVector *self);
+  CAL3D_WRAPPER_API void CalVector_Op_Add(struct CalVector *pResult, struct CalVector *pV, struct CalVector *pU);
+  CAL3D_WRAPPER_API void CalVector_Op_Subtract(struct CalVector *pResult, struct CalVector *pV, struct CalVector *pU);
+  CAL3D_WRAPPER_API void CalVector_CalVector_Op_Scale(struct CalVector *pResult, struct CalVector *pV, float d);
+  CAL3D_WRAPPER_API void CalVector_CalVector_Op_InverseScale(struct CalVector *pResult, struct CalVector *pV, float d);
+  CAL3D_WRAPPER_API float CalVector_Op_Scalar(struct CalVector *pV, struct CalVector *pU);
+  CAL3D_WRAPPER_API void CalVector_Op_Cross(struct CalVector *pResult, struct CalVector *pV, struct CalVector *pU);
+  CAL3D_WRAPPER_API void CalVector_Scale(struct CalVector *self, float d);
+  CAL3D_WRAPPER_API void CalVector_Set(struct CalVector *self, float vx, float vy, float vz);
+  CAL3D_WRAPPER_API void CalVector_Subtract(struct CalVector *self, struct CalVector *pV);
+  CAL3D_WRAPPER_API void CalVector_Transform(struct CalVector *self, struct CalQuaternion *pQ);

 #ifdef __cplusplus
 }


NVMe: Use ida for nvme device instance

NVMe: Use ida for nvme device instance

Signed-off-by: Quoc-Son Anh <4cfe32f15d9e8f50dd81cea62a65fc2d508da4b4@intel.com>
Signed-off-by: Matthew Wilcox <ed1245e46949b7b8f2bca25d41520ebc8aeefcf8@intel.com>

--- drivers/block/nvme.c
+++ drivers/block/nvme.c
@@ -1576,15 +1576,33 @@
 	dma_pool_destroy(dev->prp_small_pool);
 }

-/* XXX: Use an ida or something to let remove / add work correctly */
-static void nvme_set_instance(struct nvme_dev *dev)
-{
-	static int instance;
-	dev->instance = instance++;
+static DEFINE_IDA(nvme_instance_ida);
+
+static int nvme_set_instance(struct nvme_dev *dev)
+{
+	int instance, error;
+
+	do {
+		if (!ida_pre_get(&nvme_instance_ida, GFP_KERNEL))
+			return -ENODEV;
+
+		spin_lock(&dev_list_lock);
+		error = ida_get_new(&nvme_instance_ida, &instance);
+		spin_unlock(&dev_list_lock);
+	} while (error == -EAGAIN);
+
+	if (error)
+		return -ENODEV;
+
+	dev->instance = instance;
+	return 0;
 }

 static void nvme_release_instance(struct nvme_dev *dev)
 {
+	spin_lock(&dev_list_lock);
+	ida_remove(&nvme_instance_ida, dev->instance);
+	spin_unlock(&dev_list_lock);
 }

 static int __devinit nvme_probe(struct pci_dev *pdev,
@@ -1617,7 +1635,10 @@
 	pci_set_drvdata(pdev, dev);
 	dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
 	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-	nvme_set_instance(dev);
+	result = nvme_set_instance(dev);
+	if (result)
+		goto disable;
+
 	dev->entry[0].vector = pdev->irq;

 	result = nvme_setup_prp_pools(dev);


mfd: AB3100 propagate error

mfd: AB3100 propagate error

This makes ab3100_set_register_interruptible() propagate the error
code from suboperations properly so it can be handles properly.
(A special case comes from signal interruption.)

Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@stericsson.com>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- drivers/mfd/ab3100-core.c
+++ drivers/mfd/ab3100-core.c
@@ -107,7 +107,7 @@
 		err = 0;
 	}
 	mutex_unlock(&ab3100->access_mutex);
-	return 0;
+	return err;
 }
 EXPORT_SYMBOL(ab3100_set_register_interruptible);


Set removed flag, before signalling remove

--- src/call-member-content.c
+++ src/call-member-content.c
@@ -462,14 +462,16 @@
 {
   GabbleCallMemberContentPrivate *priv = self->priv;

+  if (priv->removed)
+    return;
+
+  priv->removed = TRUE;
+
   g_object_ref (self);
   /* Remove ourselves from the sesison */
   if (priv->jingle_content != NULL)
       gabble_jingle_content_remove (priv->jingle_content, TRUE);

-  if (!priv->removed)
-    g_signal_emit (self, signals[REMOVED], 0);
-  priv->removed = TRUE;
-
+  g_signal_emit (self, signals[REMOVED], 0);
   g_object_unref (self);
 }


- adding some more well known ids to call_traits

--- fatal/type/call_traits.h
+++ fatal/type/call_traits.h
@@ -249,27 +249,52 @@
 struct call_traits {
 # define FATAL_CALL_TRAITS_IMPL(Name) FATAL_CALL_TRAITS(Name, Name)

+  FATAL_CALL_TRAITS_IMPL(abort);
+  FATAL_CALL_TRAITS_IMPL(absolute);
   FATAL_CALL_TRAITS_IMPL(add);
+  FATAL_CALL_TRAITS_IMPL(advance);
   FATAL_CALL_TRAITS_IMPL(append);
+  FATAL_CALL_TRAITS_IMPL(append_to);
+  FATAL_CALL_TRAITS_IMPL(apply);
   FATAL_CALL_TRAITS_IMPL(assign);
   FATAL_CALL_TRAITS_IMPL(at);
   FATAL_CALL_TRAITS_IMPL(back);
   FATAL_CALL_TRAITS_IMPL(begin);
   FATAL_CALL_TRAITS_IMPL(binary_search);
-  FATAL_CALL_TRAITS_IMPL(c_str);
+  FATAL_CALL_TRAITS_IMPL(bind);
+  FATAL_CALL_TRAITS_IMPL(call);
+  FATAL_CALL_TRAITS_IMPL(cancel);
   FATAL_CALL_TRAITS_IMPL(capacity);
   FATAL_CALL_TRAITS_IMPL(cbegin);
   FATAL_CALL_TRAITS_IMPL(cend);
+  FATAL_CALL_TRAITS_IMPL(center);
+  FATAL_CALL_TRAITS_IMPL(child);
+  FATAL_CALL_TRAITS_IMPL(children);
   FATAL_CALL_TRAITS_IMPL(clear);
+  FATAL_CALL_TRAITS_IMPL(clone);
   FATAL_CALL_TRAITS_IMPL(compare);
+  FATAL_CALL_TRAITS_IMPL(compress);
+  FATAL_CALL_TRAITS_IMPL(concat);
+  FATAL_CALL_TRAITS_IMPL(concatenate);
+  FATAL_CALL_TRAITS_IMPL(condition);
+  FATAL_CALL_TRAITS_IMPL(config);
+  FATAL_CALL_TRAITS_IMPL(configuration);
+  FATAL_CALL_TRAITS_IMPL(configure);
+  FATAL_CALL_TRAITS_IMPL(construct);
+  FATAL_CALL_TRAITS_IMPL(contains);
+  FATAL_CALL_TRAITS_IMPL(convert);
   FATAL_CALL_TRAITS_IMPL(copy);
   FATAL_CALL_TRAITS_IMPL(count);
+  FATAL_CALL_TRAITS_IMPL(cptr);
   FATAL_CALL_TRAITS_IMPL(crbegin);
+  FATAL_CALL_TRAITS_IMPL(cref);
   FATAL_CALL_TRAITS_IMPL(crend);
+  FATAL_CALL_TRAITS_IMPL(c_str);
   FATAL_CALL_TRAITS_IMPL(data);
   FATAL_CALL_TRAITS_IMPL(decode);
   FATAL_CALL_TRAITS_IMPL(dequeue);
   FATAL_CALL_TRAITS_IMPL(deserialize);
+  FATAL_CALL_TRAITS_IMPL(destroy);
   FATAL_CALL_TRAITS_IMPL(emplace);
   FATAL_CALL_TRAITS_IMPL(emplace_back);
   FATAL_CALL_TRAITS_IMPL(emplace_front);
@@ -277,93 +302,177 @@
   FATAL_CALL_TRAITS_IMPL(encode);
   FATAL_CALL_TRAITS_IMPL(end);
   FATAL_CALL_TRAITS_IMPL(enqueue);
+  FATAL_CALL_TRAITS_IMPL(equal);
   FATAL_CALL_TRAITS_IMPL(equal_range);
   FATAL_CALL_TRAITS_IMPL(erase);
+  FATAL_CALL_TRAITS_IMPL(exact);
+  FATAL_CALL_TRAITS_IMPL(exit);
   FATAL_CALL_TRAITS_IMPL(extension);
   FATAL_CALL_TRAITS_IMPL(find);
   FATAL_CALL_TRAITS_IMPL(find_first_not_of);
   FATAL_CALL_TRAITS_IMPL(find_first_of);
   FATAL_CALL_TRAITS_IMPL(find_last_not_of);
   FATAL_CALL_TRAITS_IMPL(find_last_of);
+  FATAL_CALL_TRAITS_IMPL(finish);
+  FATAL_CALL_TRAITS_IMPL(finished);
+  FATAL_CALL_TRAITS_IMPL(first);
   FATAL_CALL_TRAITS_IMPL(for_each);
   FATAL_CALL_TRAITS_IMPL(foreach);
+  FATAL_CALL_TRAITS_IMPL(foreach_if);
+  FATAL_CALL_TRAITS_IMPL(fork);
   FATAL_CALL_TRAITS_IMPL(forward);
+  FATAL_CALL_TRAITS_IMPL(fourth);
   FATAL_CALL_TRAITS_IMPL(freeze);
+  FATAL_CALL_TRAITS_IMPL(from);
   FATAL_CALL_TRAITS_IMPL(front);
   FATAL_CALL_TRAITS_IMPL(get);
+  FATAL_CALL_TRAITS_IMPL(getline);
   FATAL_CALL_TRAITS_IMPL(get_pointer);
   FATAL_CALL_TRAITS_IMPL(get_reference);
-  FATAL_CALL_TRAITS_IMPL(getline);
+  FATAL_CALL_TRAITS_IMPL(go);
+  FATAL_CALL_TRAITS_IMPL(halt);
   FATAL_CALL_TRAITS_IMPL(hash);
   FATAL_CALL_TRAITS_IMPL(id);
   FATAL_CALL_TRAITS_IMPL(index);
   FATAL_CALL_TRAITS_IMPL(index_of);
+  FATAL_CALL_TRAITS_IMPL(init);
+  FATAL_CALL_TRAITS_IMPL(initialize);
   FATAL_CALL_TRAITS_IMPL(insert);
+  FATAL_CALL_TRAITS_IMPL(join);
+  FATAL_CALL_TRAITS_IMPL(joinable);
+  FATAL_CALL_TRAITS_IMPL(last);
+  FATAL_CALL_TRAITS_IMPL(left);
   FATAL_CALL_TRAITS_IMPL(length);
+  FATAL_CALL_TRAITS_IMPL(lift);
+  FATAL_CALL_TRAITS_IMPL(limit);
+  FATAL_CALL_TRAITS_IMPL(list);
+  FATAL_CALL_TRAITS_IMPL(lock);
+  FATAL_CALL_TRAITS_IMPL(longest);
+  FATAL_CALL_TRAITS_IMPL(loop);
   FATAL_CALL_TRAITS_IMPL(lower_bound);
+  FATAL_CALL_TRAITS_IMPL(map);
+  FATAL_CALL_TRAITS_IMPL(match);
   FATAL_CALL_TRAITS_IMPL(max);
   FATAL_CALL_TRAITS_IMPL(max_size);
+  FATAL_CALL_TRAITS_IMPL(mean);
   FATAL_CALL_TRAITS_IMPL(median);
   FATAL_CALL_TRAITS_IMPL(merge);
+  FATAL_CALL_TRAITS_IMPL(mid);
+  FATAL_CALL_TRAITS_IMPL(middle);
+  FATAL_CALL_TRAITS_IMPL(mimic);
   FATAL_CALL_TRAITS_IMPL(min);
   FATAL_CALL_TRAITS_IMPL(move);
+  FATAL_CALL_TRAITS_IMPL(multi_append);
   FATAL_CALL_TRAITS_IMPL(name);
   FATAL_CALL_TRAITS_IMPL(next);
   FATAL_CALL_TRAITS_IMPL(next_as);
   FATAL_CALL_TRAITS_IMPL(nth_element);
+  FATAL_CALL_TRAITS_IMPL(observe);
+  FATAL_CALL_TRAITS_IMPL(off);
+  FATAL_CALL_TRAITS_IMPL(offset);
+  FATAL_CALL_TRAITS_IMPL(on);
+  FATAL_CALL_TRAITS_IMPL(partial);
   FATAL_CALL_TRAITS_IMPL(partial_sort);
   FATAL_CALL_TRAITS_IMPL(partition);
+  FATAL_CALL_TRAITS_IMPL(pause);
+  FATAL_CALL_TRAITS_IMPL(payload);
+  FATAL_CALL_TRAITS_IMPL(pending);
+  FATAL_CALL_TRAITS_IMPL(piece);
+  FATAL_CALL_TRAITS_IMPL(pieces);
+  FATAL_CALL_TRAITS_IMPL(pinpoint);
   FATAL_CALL_TRAITS_IMPL(pointer);
+  FATAL_CALL_TRAITS_IMPL(poll);
   FATAL_CALL_TRAITS_IMPL(pop);
   FATAL_CALL_TRAITS_IMPL(pop_back);
   FATAL_CALL_TRAITS_IMPL(pop_front);
   FATAL_CALL_TRAITS_IMPL(predicate);
+  FATAL_CALL_TRAITS_IMPL(prefix);
+  FATAL_CALL_TRAITS_IMPL(prefixes);
   FATAL_CALL_TRAITS_IMPL(prev);
   FATAL_CALL_TRAITS_IMPL(previous);
+  FATAL_CALL_TRAITS_IMPL(properties);
+  FATAL_CALL_TRAITS_IMPL(property);
+  FATAL_CALL_TRAITS_IMPL(ptr);
   FATAL_CALL_TRAITS_IMPL(push);
   FATAL_CALL_TRAITS_IMPL(push_back);
   FATAL_CALL_TRAITS_IMPL(push_front);
+  FATAL_CALL_TRAITS_IMPL(put);
+  FATAL_CALL_TRAITS_IMPL(queue);
+  FATAL_CALL_TRAITS_IMPL(quit);
   FATAL_CALL_TRAITS_IMPL(rbegin);
   FATAL_CALL_TRAITS_IMPL(read);
+  FATAL_CALL_TRAITS_IMPL(ref);
   FATAL_CALL_TRAITS_IMPL(reference);
   FATAL_CALL_TRAITS_IMPL(rehash);
+  FATAL_CALL_TRAITS_IMPL(relative);
+  FATAL_CALL_TRAITS_IMPL(release);
   FATAL_CALL_TRAITS_IMPL(remove);
   FATAL_CALL_TRAITS_IMPL(rend);
   FATAL_CALL_TRAITS_IMPL(replace);
   FATAL_CALL_TRAITS_IMPL(reserve);
+  FATAL_CALL_TRAITS_IMPL(reset);
   FATAL_CALL_TRAITS_IMPL(resize);
+  FATAL_CALL_TRAITS_IMPL(resume);
   FATAL_CALL_TRAITS_IMPL(reverse);
   FATAL_CALL_TRAITS_IMPL(rfind);
+  FATAL_CALL_TRAITS_IMPL(right);
   FATAL_CALL_TRAITS_IMPL(rng);
   FATAL_CALL_TRAITS_IMPL(rotate);
   FATAL_CALL_TRAITS_IMPL(run);
   FATAL_CALL_TRAITS_IMPL(search);
+  FATAL_CALL_TRAITS_IMPL(second);
+  FATAL_CALL_TRAITS_IMPL(seek);
   FATAL_CALL_TRAITS_IMPL(select);
   FATAL_CALL_TRAITS_IMPL(serialize);
   FATAL_CALL_TRAITS_IMPL(set);
+  FATAL_CALL_TRAITS_IMPL(setup);
+  FATAL_CALL_TRAITS_IMPL(shortest);
   FATAL_CALL_TRAITS_IMPL(shrink_to_fit);
   FATAL_CALL_TRAITS_IMPL(shuffle);
+  FATAL_CALL_TRAITS_IMPL(shutdown);
   FATAL_CALL_TRAITS_IMPL(size);
+  FATAL_CALL_TRAITS_IMPL(slice);
   FATAL_CALL_TRAITS_IMPL(sort);
+  FATAL_CALL_TRAITS_IMPL(spawn);
+  FATAL_CALL_TRAITS_IMPL(split);
+  FATAL_CALL_TRAITS_IMPL(split_step);
   FATAL_CALL_TRAITS_IMPL(stable_sort);
+  FATAL_CALL_TRAITS_IMPL(stack);
+  FATAL_CALL_TRAITS_IMPL(standard_deviation);
+  FATAL_CALL_TRAITS_IMPL(start);
+  FATAL_CALL_TRAITS_IMPL(stddev);
+  FATAL_CALL_TRAITS_IMPL(steal);
+  FATAL_CALL_TRAITS_IMPL(stop);
+  FATAL_CALL_TRAITS_IMPL(str);
+  FATAL_CALL_TRAITS_IMPL(string);
   FATAL_CALL_TRAITS_IMPL(substr);
+  FATAL_CALL_TRAITS_IMPL(suspend);
   FATAL_CALL_TRAITS_IMPL(swap);
   FATAL_CALL_TRAITS_IMPL(thaw);
+  FATAL_CALL_TRAITS_IMPL(third);
   FATAL_CALL_TRAITS_IMPL(to);
   FATAL_CALL_TRAITS_IMPL(to_str);
   FATAL_CALL_TRAITS_IMPL(to_string);
   FATAL_CALL_TRAITS_IMPL(to_wstring);
+  FATAL_CALL_TRAITS_IMPL(transcode);
   FATAL_CALL_TRAITS_IMPL(transform);
   FATAL_CALL_TRAITS_IMPL(try_emplace);
   FATAL_CALL_TRAITS_IMPL(try_get);
+  FATAL_CALL_TRAITS_IMPL(try_lock);
   FATAL_CALL_TRAITS_IMPL(try_set);
   FATAL_CALL_TRAITS_IMPL(try_to);
+  FATAL_CALL_TRAITS_IMPL(turn);
+  FATAL_CALL_TRAITS_IMPL(type);
   FATAL_CALL_TRAITS_IMPL(unique);
+  FATAL_CALL_TRAITS_IMPL(unlock);
   FATAL_CALL_TRAITS_IMPL(update);
   FATAL_CALL_TRAITS_IMPL(upper_bound);
   FATAL_CALL_TRAITS_IMPL(value);
+  FATAL_CALL_TRAITS_IMPL(variance);
   FATAL_CALL_TRAITS_IMPL(visit);
   FATAL_CALL_TRAITS_IMPL(visit_if);
+  FATAL_CALL_TRAITS_IMPL(which);
+  FATAL_CALL_TRAITS_IMPL(with);
   FATAL_CALL_TRAITS_IMPL(write);

 # undef FATAL_CALL_TRAITS_IMPL


NVMe: Set request queue logical block size

Sets the request queue logical block size with the block size of the
namespace.

Signed-off-by: Keith Busch <695e2a2c1e39535baaa147c5eb4e5da14054d59f@intel.com>
Signed-off-by: Matthew Wilcox <ed1245e46949b7b8f2bca25d41520ebc8aeefcf8@intel.com>

--- drivers/block/nvme.c
+++ drivers/block/nvme.c
@@ -1344,6 +1344,7 @@
 	ns->disk = disk;
 	lbaf = id->flbas & 0xf;
 	ns->lba_shift = id->lbaf[lbaf].ds;
+	blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift);

 	disk->major = nvme_major;
 	disk->minors = NVME_MINORS;


mfd: ab3100-core: Correct code sytle problems

Corrects the following checkpatch gripes:

    WARNING: quoted string split across lines
    #95: FILE: drivers/mfd/ab3100-core.c:95:
    +			"write error (write register) "
    +			"%d bytes transferred (expected 2)\n",

    WARNING: quoted string split across lines
    #139: FILE: drivers/mfd/ab3100-core.c:139:
    +			"write error (write test register) "
    +			"%d bytes transferred (expected 2)\n",

    WARNING: quoted string split across lines
    #175: FILE: drivers/mfd/ab3100-core.c:175:
    +			"write error (send register address) "
    +			"%d bytes transferred (expected 1)\n",

    WARNING: quoted string split across lines
    #193: FILE: drivers/mfd/ab3100-core.c:193:
    +			"write error (read register) "
    +			"%d bytes transferred (expected 1)\n",

    WARNING: quoted string split across lines
    #241: FILE: drivers/mfd/ab3100-core.c:241:
    +			"write error (send first register address) "
    +			"%d bytes transferred (expected 1)\n",

    WARNING: quoted string split across lines
    #256: FILE: drivers/mfd/ab3100-core.c:256:
    +			"write error (read register page) "
    +			"%d bytes transferred (expected %d)\n",

    WARNING: quoted string split across lines
    #299: FILE: drivers/mfd/ab3100-core.c:299:
    +			"write error (maskset send address) "
    +			"%d bytes transferred (expected 1)\n",

    WARNING: quoted string split across lines
    #314: FILE: drivers/mfd/ab3100-core.c:314:
    +			"write error (maskset read register) "
    +			"%d bytes transferred (expected 1)\n",

    WARNING: quoted string split across lines
    #334: FILE: drivers/mfd/ab3100-core.c:334:
    +			"write error (write register) "
    +			"%d bytes transferred (expected 2)\n",

    WARNING: please, no spaces at the start of a line
    #374: FILE: drivers/mfd/ab3100-core.c:374:
    +  return blocking_notifier_chain_unregister(&ab3100->event_subscribers,$

    WARNING: Prefer seq_puts to seq_printf
    #458: FILE: drivers/mfd/ab3100-core.c:458:
    +	seq_printf(s, "AB3100 registers:\n");

    WARNING: quoted string split across lines
    #564: FILE: drivers/mfd/ab3100-core.c:564:
    +			 "debug write reg[0x%02x] with 0x%02x, "
    +			 "after readback: 0x%02x\n",

    WARNING: quoted string split across lines
    #723: FILE: drivers/mfd/ab3100-core.c:723:
    +			 "AB3100 P1E variant detected, "
    +			 "forcing chip to 32KHz\n");

    WARNING: quoted string split across lines
    #882: FILE: drivers/mfd/ab3100-core.c:882:
    +			"could not communicate with the AB3100 analog "
    +			"baseband chip\n");

    WARNING: quoted string split across lines
    #906: FILE: drivers/mfd/ab3100-core.c:906:
    +		dev_err(&client->dev, "accepting it anyway. Please update "
    +			"the driver.\n");

    total: 0 errors, 15 warnings, 999 lines checked

Reviewed-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>


NVMe: Renumber the special context values

If POISON_POINTER_DELTA isn't defined, ensure they're in page 0 which
should never be mapped.

Signed-off-by: Matthew Wilcox <ed1245e46949b7b8f2bca25d41520ebc8aeefcf8@intel.com>

--- drivers/block/nvme.c
+++ drivers/block/nvme.c
@@ -184,9 +184,9 @@
 };

 #define CMD_CTX_BASE		(POISON_POINTER_DELTA + sync_completion_id)
-#define CMD_CTX_CANCELLED	(0x2008 + CMD_CTX_BASE)
-#define CMD_CTX_COMPLETED	(0x2010 + CMD_CTX_BASE)
-#define CMD_CTX_INVALID		(0x2014 + CMD_CTX_BASE)
+#define CMD_CTX_CANCELLED	(0x30C + CMD_CTX_BASE)
+#define CMD_CTX_COMPLETED	(0x310 + CMD_CTX_BASE)
+#define CMD_CTX_INVALID		(0x314 + CMD_CTX_BASE)

 static unsigned long free_cmdid(struct nvme_queue *nvmeq, int cmdid)
 {


mfd: ab8500-core: Remove unused ab8500-gpio IRQ ranges

The IRQ ranges provided in ab8500-core to be passed on to the
ab8500-gpio driver are not only redundant, but they are also
causing a warning in the boot log. These IRQ ranges, like any
other MFD related IRQ resource are passed though MFD core for
automatic conversion to virtual IRQs; however, MFD core does
not support IRQ mapping of IRQ ranges. Let's just remove them.

Acked-by: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Tested-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- drivers/mfd/ab8500-core.c
+++ drivers/mfd/ab8500-core.c
@@ -591,38 +591,6 @@
 		return 0;
 }

-/* AB8500 GPIO Resources */
-static struct resource __devinitdata ab8500_gpio_resources[] = {
-	{
-		.name	= "GPIO_INT6",
-		.start	= AB8500_INT_GPIO6R,
-		.end	= AB8500_INT_GPIO41F,
-		.flags	= IORESOURCE_IRQ,
-	}
-};
-
-/* AB9540 GPIO Resources */
-static struct resource __devinitdata ab9540_gpio_resources[] = {
-	{
-		.name	= "GPIO_INT6",
-		.start	= AB8500_INT_GPIO6R,
-		.end	= AB8500_INT_GPIO41F,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.name	= "GPIO_INT14",
-		.start	= AB9540_INT_GPIO50R,
-		.end	= AB9540_INT_GPIO54R,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.name	= "GPIO_INT15",
-		.start	= AB9540_INT_GPIO50F,
-		.end	= AB9540_INT_GPIO54F,
-		.flags	= IORESOURCE_IRQ,
-	}
-};
-
 static struct resource __devinitdata ab8500_gpadc_resources[] = {
 	{
 		.name	= "HW_CONV_END",
@@ -1065,8 +1033,6 @@
 	{
 		.name = "ab8500-gpio",
 		.of_compatible = "stericsson,ab8500-gpio",
-		.num_resources = ARRAY_SIZE(ab8500_gpio_resources),
-		.resources = ab8500_gpio_resources,
 	},
 	{
 		.name = "ab8500-usb",
@@ -1083,8 +1049,6 @@
 static struct mfd_cell __devinitdata ab9540_devs[] = {
 	{
 		.name = "ab8500-gpio",
-		.num_resources = ARRAY_SIZE(ab9540_gpio_resources),
-		.resources = ab9540_gpio_resources,
 	},
 	{
 		.name = "ab9540-usb",


fsldma: Fix compile warnings

fsldma: Fix compile warnings

We we build with dma_addr_t as a 64-bit quantity we get:

drivers/dma/fsldma.c: In function 'fsl_chan_xfer_ld_queue':
drivers/dma/fsldma.c:625: warning: cast to pointer from integer of different size
drivers/dma/fsldma.c: In function 'fsl_dma_chan_do_interrupt':
drivers/dma/fsldma.c:737: warning: cast to pointer from integer of different size
drivers/dma/fsldma.c:737: warning: cast to pointer from integer of different size
drivers/dma/fsldma.c: In function 'of_fsl_dma_probe':
drivers/dma/fsldma.c:927: warning: cast to pointer from integer of different

Signed-off-by: Kumar Gala <383ef5577c6e1178b93f59ec8d0936f76d2a98c4@kernel.crashing.org>
Acked-by: Dan Williams <24ee2bf0bd8ac766c348bf1f0639943bac1535c6@intel.com>

--- drivers/dma/fsldma.c
+++ drivers/dma/fsldma.c
@@ -622,8 +622,8 @@
 	if (ld_node != &fsl_chan->ld_queue) {
 		/* Get the ld start address from ld_queue */
 		next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
-		dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n",
-				(void *)next_dest_addr);
+		dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%llx\n",
+				(unsigned long long)next_dest_addr);
 		set_cdar(fsl_chan, next_dest_addr);
 		dma_start(fsl_chan);
 	} else {
@@ -734,8 +734,9 @@
 	 */
 	if (stat & FSL_DMA_SR_EOSI) {
 		dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n");
-		dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
-			(void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
+		dev_dbg(fsl_chan->dev, "event: clndar 0x%llx, nlndar 0x%llx\n",
+			(unsigned long long)get_cdar(fsl_chan),
+			(unsigned long long)get_ndar(fsl_chan));
 		stat &= ~FSL_DMA_SR_EOSI;
 		update_cookie = 1;
 	}
@@ -925,8 +926,8 @@
 	}

 	dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
-			"controller at %p...\n",
-			match->compatible, (void *)fdev->reg.start);
+			"controller at 0x%llx...\n",
+			match->compatible, (unsigned long long)fdev->reg.start);
 	fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
 						- fdev->reg.start + 1);


mfd: max8925-i2c: Fix 'blank line after declarations' warning

This is part of an effort to clean-up the MFD subsystem.

WARNING: Missing a blank line after declarations
+       int ret;
+       ret = i2c_add_driver(&max8925_driver);

total: 0 errors, 1 warnings, 275 lines checked

Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>


Expanded comments a little

Expanded comments a little

--- src/api/api.h
+++ src/api/api.h
@@ -54,8 +54,9 @@
  *
  * When data is available, the ready() function will return EREADY and data will be returned by a read_acquire call. You
  * should not normally check ready() manually, but use a camio_multiplexer instead to do this. The maximum size of the
- * read_vev_len is stream dependent. read_register may also be called multiple times, but some streams will only support a
- * limited number (e.g 1) of outstanding requests.
+ * read_vec_len is stream dependent you can check the max_read_req_vec_len feature for this size. read_register() may be
+ * called multiple times, but some streams will only support a limited number (e.g 1) of outstanding requests. You can check
+ * the max_read_reqs feature for this size.
  *
  * Notes:
  * - If the source offset is non-zero, the read will try to retrieve data at offset bytes from the beginning of the source.


fsldma: Split the MPC83xx event from MPC85xx and refine irq codes.

Split MPC83xx EOCDI event from MPC85xx EOLNI event, which is
also need to update cookie and start the next transfer.
The DMA channel irq handler function code is refined.
The patch is tested on MPC8377MDS board.

Signed-off-by: Zhang Wei <fe132b35e7c83913143b70239c4ec3c76b49c183@freescale.com>
Signed-off-by; Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <24ee2bf0bd8ac766c348bf1f0639943bac1535c6@intel.com>

--- drivers/dma/fsldma.c
+++ drivers/dma/fsldma.c
@@ -696,6 +696,8 @@
 {
 	struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
 	u32 stat;
+	int update_cookie = 0;
+	int xfer_ld_q = 0;

 	stat = get_sr(fsl_chan);
 	dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
@@ -720,8 +722,8 @@
 			 * Now, update the completed cookie, and continue the
 			 * next uncompleted transfer.
 			 */
-			fsl_dma_update_completed_cookie(fsl_chan);
-			fsl_chan_xfer_ld_queue(fsl_chan);
+			update_cookie = 1;
+			xfer_ld_q = 1;
 		}
 		stat &= ~FSL_DMA_SR_PE;
 	}
@@ -734,19 +736,33 @@
 		dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
 			(void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
 		stat &= ~FSL_DMA_SR_EOSI;
-		fsl_dma_update_completed_cookie(fsl_chan);
+		update_cookie = 1;
+	}
+
+	/* For MPC8349, EOCDI event need to update cookie
+	 * and start the next transfer if it exist.
+	 */
+	if (stat & FSL_DMA_SR_EOCDI) {
+		dev_dbg(fsl_chan->dev, "event: End-of-Chain link INT\n");
+		stat &= ~FSL_DMA_SR_EOCDI;
+		update_cookie = 1;
+		xfer_ld_q = 1;
 	}

 	/* If it current transfer is the end-of-transfer,
 	 * we should clear the Channel Start bit for
 	 * prepare next transfer.
 	 */
-	if (stat & (FSL_DMA_SR_EOLNI | FSL_DMA_SR_EOCDI)) {
+	if (stat & FSL_DMA_SR_EOLNI) {
 		dev_dbg(fsl_chan->dev, "event: End-of-link INT\n");
 		stat &= ~FSL_DMA_SR_EOLNI;
+		xfer_ld_q = 1;
+	}
+
+	if (update_cookie)
+		fsl_dma_update_completed_cookie(fsl_chan);
+	if (xfer_ld_q)
 		fsl_chan_xfer_ld_queue(fsl_chan);
-	}
-
 	if (stat)
 		dev_dbg(fsl_chan->dev, "event: unhandled sr 0x%02x\n",
 					stat);


mtd: ixp4xx map: use resource_size

mtd: ixp4xx map: use resource_size

Use the resource_size inline function instead of manually calculating
the resource size. This reduces the chance of introducing off-by-one
errors.

Signed-off-by: Tobias Klauser <9249c549618448e4c699e8032ba6c7f0d7fd4b7f@distanz.ch>
Signed-off-by: Artem Bityutskiy <19b5733dcea388885746d36043d3568bba5b4df7@nokia.com>
Signed-off-by: David Woodhouse <b460d66aaf00c296a3db1c1d9eeafc081d5f7d70@intel.com>

--- drivers/mtd/maps/ixp4xx.c
+++ drivers/mtd/maps/ixp4xx.c
@@ -210,7 +210,7 @@
 	 * not attempt to do a direct access on us.
 	 */
 	info->map.phys = NO_XIP;
-	info->map.size = dev->resource->end - dev->resource->start + 1;
+	info->map.size = resource_size(dev->resource);

 	/*
 	 * We only support 16-bit accesses for now. If and when
@@ -224,7 +224,7 @@
 	info->map.copy_from = ixp4xx_copy_from,

 	info->res = request_mem_region(dev->resource->start,
-			dev->resource->end - dev->resource->start + 1,
+			resource_size(dev->resource),
 			"IXP4XXFlash");
 	if (!info->res) {
 		printk(KERN_ERR "IXP4XXFlash: Could not reserve memory region\n");
@@ -233,7 +233,7 @@
 	}

 	info->map.virt = ioremap(dev->resource->start,
-				 dev->resource->end - dev->resource->start + 1);
+				 resource_size(dev->resource));
 	if (!info->map.virt) {
 		printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n");
 		err = -EIO;


HID: hidraw: don't deallocate memory when it is in use

When a device is unplugged, wait for all processes that have opened the device
to close before deallocating the device.

Signed-off-by: Ratan Nalumasu <1a6392111221da097f73cb17b2222947b094d38e@google.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- drivers/hid/hidraw.c
+++ drivers/hid/hidraw.c
@@ -42,6 +42,7 @@
 static struct class *hidraw_class;
 static struct hidraw *hidraw_table[HIDRAW_MAX_DEVICES];
 static DEFINE_MUTEX(minors_lock);
+static void drop_ref(struct hidraw *hid, int exists_bit);

 static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
@@ -113,7 +114,7 @@
 	__u8 *buf;
 	int ret = 0;

-	if (!hidraw_table[minor]) {
+	if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
 		ret = -ENODEV;
 		goto out;
 	}
@@ -261,7 +262,7 @@
 	}

 	mutex_lock(&minors_lock);
-	if (!hidraw_table[minor]) {
+	if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
 		err = -ENODEV;
 		goto out_unlock;
 	}
@@ -298,36 +299,12 @@
 static int hidraw_release(struct inode * inode, struct file * file)
 {
 	unsigned int minor = iminor(inode);
-	struct hidraw *dev;
 	struct hidraw_list *list = file->private_data;
-	int ret;
-	int i;
-
-	mutex_lock(&minors_lock);
-	if (!hidraw_table[minor]) {
-		ret = -ENODEV;
-		goto unlock;
-	}
-
+
+	drop_ref(hidraw_table[minor], 0);
 	list_del(&list->node);
-	dev = hidraw_table[minor];
-	if (!--dev->open) {
-		if (list->hidraw->exist) {
-			hid_hw_power(dev->hid, PM_HINT_NORMAL);
-			hid_hw_close(dev->hid);
-		} else {
-			kfree(list->hidraw);
-		}
-	}
-
-	for (i = 0; i < HIDRAW_BUFFER_SIZE; ++i)
-		kfree(list->buffer[i].value);
 	kfree(list);
-	ret = 0;
-unlock:
-	mutex_unlock(&minors_lock);
-
-	return ret;
+	return 0;
 }

 static long hidraw_ioctl(struct file *file, unsigned int cmd,
@@ -529,21 +506,7 @@
 void hidraw_disconnect(struct hid_device *hid)
 {
 	struct hidraw *hidraw = hid->hidraw;
-
-	mutex_lock(&minors_lock);
-	hidraw->exist = 0;
-
-	device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
-
-	hidraw_table[hidraw->minor] = NULL;
-
-	if (hidraw->open) {
-		hid_hw_close(hid);
-		wake_up_interruptible(&hidraw->wait);
-	} else {
-		kfree(hidraw);
-	}
-	mutex_unlock(&minors_lock);
+	drop_ref(hidraw, 1);
 }
 EXPORT_SYMBOL_GPL(hidraw_disconnect);

@@ -585,3 +548,23 @@
 	unregister_chrdev_region(dev_id, HIDRAW_MAX_DEVICES);

 }
+
+static void drop_ref(struct hidraw *hidraw, int exists_bit)
+{
+	mutex_lock(&minors_lock);
+	if (exists_bit) {
+		hid_hw_close(hidraw->hid);
+		hidraw->exist = 0;
+		if (hidraw->open)
+			wake_up_interruptible(&hidraw->wait);
+	} else {
+		--hidraw->open;
+	}
+
+	if (!hidraw->open && !hidraw->exist) {
+		device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
+		hidraw_table[hidraw->minor] = NULL;
+		kfree(hidraw);
+	}
+	mutex_unlock(&minors_lock);
+}


pch_can: Fix miss-setting status issue

pch_can: Fix miss-setting status issue

Modify miss-setting status issue at suspend.

Signed-off-by: Tomoya MORINAGA <d1171211b1154da483963a5aecdf2602ee7000da@dsn.okisemi.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


HID: hidraw_connect() memleak fix

HID: hidraw_connect() memleak fix

It looks like hidraw_connect() is leaking memory in case of failure.
Also it should return -ENOMEM when kzalloc fails.

Signed-off-by: Mariusz Kozlowski <5702b3f6ed7bf13b13f30a976dbb318af82515c3@tuxland.pl>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- drivers/hid/hidraw.c
+++ drivers/hid/hidraw.c
@@ -282,7 +282,7 @@

 int hidraw_connect(struct hid_device *hid)
 {
-	int minor, result = -EINVAL;
+	int minor, result;
 	struct hidraw *dev;

 	/* TODO currently we accept any HID device. This should later
@@ -290,8 +290,11 @@
 	 * non-input applications
 	 */

-	if (!(dev = kzalloc(sizeof(struct hidraw), GFP_KERNEL)))
-		return -1;
+	dev = kzalloc(sizeof(struct hidraw), GFP_KERNEL);
+	if (!dev)
+		return -ENOMEM;
+
+	result = -EINVAL;

 	spin_lock(&minors_lock);

@@ -305,8 +308,10 @@

 	spin_unlock(&minors_lock);

-	if (result)
-		goto out;
+	if (result) {
+		kfree(dev);
+		goto out;
+	}

 	dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
 				"%s%d", "hidraw", minor);
@@ -316,6 +321,7 @@
 		hidraw_table[minor] = NULL;
 		spin_unlock(&minors_lock);
 		result = PTR_ERR(dev->dev);
+		kfree(dev);
 		goto out;
 	}


drivers/net/cxgb3/t3_hw.c: use new hex_to_bin() method

Get rid of own implementation of hex_to_bin().

Signed-off-by: Andy Shevchenko <f22fd278e04b059f9eabb8d18172c92cd71ea30e@nokia.com>
Acked-by: Divy Le Ray <c440f8554972344360c4411616466cde120c39c9@chelsio.com>
Cc: "David S. Miller" <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>