]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
ipc: Remove compiler warnings
authorSam Nelson <sam.nelson@ti.com>
Sun, 21 Oct 2018 20:52:52 +0000 (16:52 -0400)
committerSam Nelson <sam.nelson@ti.com>
Tue, 23 Oct 2018 01:23:11 +0000 (21:23 -0400)
Removes warnings due to Assert_isTrue id set to NULL
Also removes warnings due to int to pointer conversion

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
packages/ti/ipc/ipcmgr/IpcMgr.c
packages/ti/sdo/ipc/GateMP.c
packages/ti/sdo/ipc/ListMP.c
packages/ti/sdo/ipc/MessageQ.c
packages/ti/sdo/utils/NameServer.c

index 14d45a090420d2aeb3fd2390f11f921c62b15f18..a7567d1685d895961c9138ba2e92c6451442fb98 100644 (file)
@@ -64,7 +64,7 @@
  */
 Void IpcMgr_rpmsgStartup(Void)
 {
-    Assert_isTrue(MultiProc_self() != MultiProc_getId("HOST"), NULL);
+    Assert_isTrue(MultiProc_self() != MultiProc_getId("HOST"), 0);
     RPMessage_init(MultiProc_getId("HOST"));
 
 #ifdef IpcMgr_USEDEH
index d604524602d06f5e7ced2b1912dec2de94c074c0..5e2bc0b62d7ce2a379ec93138ca3c3d6c8c29d6f 100644 (file)
@@ -655,7 +655,7 @@ Void ti_sdo_ipc_GateMP_setRegion0Reserved(Ptr sharedAddr)
      */
     offset = _Ipc_roundup(sizeof(ti_sdo_ipc_GateMP_Reserved), minAlign);
     GateMP_module->remoteSystemInUse =
-        (Ptr)((UInt32)sharedAddr + offset);
+        (Ptr)((uintptr_t)sharedAddr + offset);
 
     if (GateMP_module->numRemoteSystem != 0) {
         memset(GateMP_module->remoteSystemInUse, 0,
@@ -759,21 +759,21 @@ Void ti_sdo_ipc_GateMP_setRegion0Reserved(Ptr sharedAddr)
     if (GateMP_module->hostSupport == TRUE) {
         /* Add special entry to store inuse arrays' location and size */
         ret = _GateMP_virtToPhys(
-            (UInt32)GateMP_module->remoteSystemInUse, &nsValue[0]);
-        Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+            (uintptr_t)GateMP_module->remoteSystemInUse, &nsValue[0]);
+        Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)0);
         (void)ret;   /* silence unused var warning when asserts disabled */
         if (GateMP_module->numRemoteCustom1 != 0) {
             ret = _GateMP_virtToPhys(
-                (UInt32)GateMP_module->remoteCustom1InUse, &nsValue[1]);
-            Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+                (uintptr_t)GateMP_module->remoteCustom1InUse, &nsValue[1]);
+            Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)0);
         }
         else {
             nsValue[1] = 0;
         }
         if (GateMP_module->numRemoteCustom2 != 0) {
             ret = _GateMP_virtToPhys(
-                (UInt32)GateMP_module->remoteCustom2InUse, &nsValue[2]);
-            Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+                (uintptr_t)GateMP_module->remoteCustom2InUse, &nsValue[2]);
+            Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)0);
        }
         else {
             nsValue[2] = 0;
@@ -813,7 +813,7 @@ Void ti_sdo_ipc_GateMP_openRegion0Reserved(Ptr sharedAddr)
 
     offset = _Ipc_roundup(sizeof(ti_sdo_ipc_GateMP_Reserved), minAlign);
     GateMP_module->remoteSystemInUse =
-        (Ptr)((UInt32)sharedAddr + offset);
+        (Ptr)((uintptr_t)sharedAddr + offset);
 
     /*
      *  initialize the in-use array in shared memory for the custom1 gates.
@@ -871,7 +871,7 @@ Int ti_sdo_ipc_GateMP_attach(UInt16 remoteProcId, Ptr sharedAddr)
     /* get region 0 information */
     SharedRegion_getEntry(0, &entry);
 
-    gateMPsharedAddr = (Ptr)((UInt32)sharedAddr +
+    gateMPsharedAddr = (Ptr)((uintptr_t)sharedAddr +
                        ti_sdo_ipc_GateMP_getRegion0ReservedSize());
 
     if ((entry.ownerProcId != MultiProc_self()) &&
@@ -954,7 +954,7 @@ Int ti_sdo_ipc_GateMP_start(Ptr sharedAddr)
 
         /* create default GateMP */
         ti_sdo_ipc_GateMP_Params_init(&gateMPParams);
-        gateMPParams.sharedAddr = (Ptr)((UInt32)sharedAddr +
+        gateMPParams.sharedAddr = (Ptr)((uintptr_t)sharedAddr +
                 ti_sdo_ipc_GateMP_getRegion0ReservedSize());
         gateMPParams.localProtect  = ti_sdo_ipc_GateMP_LocalProtect_TASKLET;
         gateMPParams.name = "_GateMP_TI_dGate";
@@ -1078,7 +1078,7 @@ Int ti_sdo_ipc_GateMP_Instance_init(ti_sdo_ipc_GateMP_Object *obj,
 
         /* TODO: host side created gates cannot have proxy memory */
         if (obj->attrs != NULL) {
-            obj->proxyAttrs = (Ptr)((UInt32)obj->attrs + offset);
+            obj->proxyAttrs = (Ptr)((uintptr_t)obj->attrs + offset);
         }
         else {
             obj->proxyAttrs = NULL;
@@ -1127,12 +1127,12 @@ Int ti_sdo_ipc_GateMP_Instance_init(ti_sdo_ipc_GateMP_Object *obj,
             }
 
             if (params->name) {
-                nsValue[0] = (UInt32)obj->attrs;
+                nsValue[0] = (uintptr_t)obj->attrs;
                 /*
                  *  Top 16 bits = procId of creator
                  *  Bottom 16 bits = '0' if local, '1' otherwise
                  */
-                nsValue[1] = ((UInt32)MultiProc_self()) << 16;
+                nsValue[1] = ((uintptr_t)MultiProc_self()) << 16;
 
                 if (GateMP_module->hostSupport == TRUE) {
                     nsValue[2] = obj->attrs->arg;
@@ -1182,7 +1182,7 @@ Int ti_sdo_ipc_GateMP_Instance_init(ti_sdo_ipc_GateMP_Object *obj,
 
             offset = _Ipc_roundup(sizeof(ti_sdo_ipc_GateMP_Attrs), minAlign);
 
-            obj->proxyAttrs = (Ptr)((UInt32)obj->attrs + offset);
+            obj->proxyAttrs = (Ptr)((uintptr_t)obj->attrs + offset);
         }
         else {
             /* creating using sharedAddr */
@@ -1203,12 +1203,12 @@ Int ti_sdo_ipc_GateMP_Instance_init(ti_sdo_ipc_GateMP_Object *obj,
 
             /* Assert that sharedAddr has correct alignment */
             Assert_isTrue(minAlign == 0 ||
-                          ((UInt32)params->sharedAddr % minAlign) == 0,
+                          ((uintptr_t)params->sharedAddr % minAlign) == 0,
                           ti_sdo_ipc_Ipc_A_addrNotCacheAligned);
 
             offset = _Ipc_roundup(sizeof(ti_sdo_ipc_GateMP_Attrs), minAlign);
 
-            obj->proxyAttrs = (Ptr)((UInt32)obj->attrs + offset);
+            obj->proxyAttrs = (Ptr)((uintptr_t)obj->attrs + offset);
         }
     }
 
index 2f2bdb1886f8decd0ed6fbb7192518246ec6cae7..d1a9bb44c3e955a6190799ee9511dd0d3817e1fc 100644 (file)
@@ -927,7 +927,7 @@ Int ti_sdo_ipc_ListMP_Instance_init(ti_sdo_ipc_ListMP_Object *obj,
 
         /* Assert that sharedAddr is cache aligned */
         Assert_isTrue((obj->cacheLineSize == 0) ||
-                      ((UInt32)params->sharedAddr % obj->cacheLineSize == 0),
+                      ((uintptr_t)params->sharedAddr % obj->cacheLineSize == 0),
                       ti_sdo_ipc_Ipc_A_addrNotCacheAligned);
     }
 
index fdb883bd2abc7d130d717908fc2358e983d3b9a3..da85a1e5cba64f0bb38154e6f1783de6ebe9784e 100644 (file)
@@ -157,7 +157,7 @@ Void MessageQ_Params_init__S(MessageQ_Params *params, Int version)
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }
 }
@@ -281,7 +281,7 @@ MessageQ_Handle MessageQ_create(String name, const MessageQ_Params *pp)
             ps.queueIndex = ((MessageQ_Params_Version2 *)pp)->queueIndex;
         }
         else {
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
         }
 
         handle = ti_sdo_ipc_MessageQ_create(name, &ps, &eb);
@@ -572,7 +572,7 @@ Int MessageQ_put(MessageQ_QueueId queueId, MessageQ_Msg msg)
                 break;
 
             default:
-                Assert_isTrue(FALSE, NULL);
+                Assert_isTrue(FALSE, 0);
                 break;
         }
 
@@ -852,7 +852,7 @@ Bool ti_sdo_ipc_MessageQ_registerTransport(IMessageQTransport_Handle handle,
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }
 
@@ -895,7 +895,7 @@ Void ti_sdo_ipc_MessageQ_unregisterTransport(UInt16 procId, UInt priority)
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }
 
index 55240befe12445bf207eaeacab3920c3ab1b265d..8298c91d271f996f07fe2805b1fdfcf81f350484 100644 (file)
@@ -363,7 +363,7 @@ Int NameServer_get(NameServer_Handle handle, String name, Ptr value,
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }
 
@@ -878,7 +878,7 @@ Bool ti_sdo_utils_NameServer_isRegistered(UInt16 procId)
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }
 
@@ -956,7 +956,7 @@ Void ti_sdo_utils_NameServer_unregisterRemoteDriver(UInt16 procId)
             break;
 
         default:
-            Assert_isTrue(FALSE, NULL);
+            Assert_isTrue(FALSE, 0);
             break;
     }