From 99bd52b7a6f22b2ec9c18f1e8351cf1d9347a2b2 Mon Sep 17 00:00:00 2001 From: Sam Nelson Date: Sun, 21 Oct 2018 16:52:52 -0400 Subject: [PATCH] ipc: Remove compiler warnings Removes warnings due to Assert_isTrue id set to NULL Also removes warnings due to int to pointer conversion Signed-off-by: Sam Nelson --- packages/ti/ipc/ipcmgr/IpcMgr.c | 2 +- packages/ti/sdo/ipc/GateMP.c | 32 +++++++++++++++--------------- packages/ti/sdo/ipc/ListMP.c | 2 +- packages/ti/sdo/ipc/MessageQ.c | 10 +++++----- packages/ti/sdo/utils/NameServer.c | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/ti/ipc/ipcmgr/IpcMgr.c b/packages/ti/ipc/ipcmgr/IpcMgr.c index 14d45a0..a7567d1 100644 --- a/packages/ti/ipc/ipcmgr/IpcMgr.c +++ b/packages/ti/ipc/ipcmgr/IpcMgr.c @@ -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 diff --git a/packages/ti/sdo/ipc/GateMP.c b/packages/ti/sdo/ipc/GateMP.c index d604524..5e2bc0b 100644 --- a/packages/ti/sdo/ipc/GateMP.c +++ b/packages/ti/sdo/ipc/GateMP.c @@ -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); } } diff --git a/packages/ti/sdo/ipc/ListMP.c b/packages/ti/sdo/ipc/ListMP.c index 2f2bdb1..d1a9bb4 100644 --- a/packages/ti/sdo/ipc/ListMP.c +++ b/packages/ti/sdo/ipc/ListMP.c @@ -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); } diff --git a/packages/ti/sdo/ipc/MessageQ.c b/packages/ti/sdo/ipc/MessageQ.c index fdb883b..da85a1e 100644 --- a/packages/ti/sdo/ipc/MessageQ.c +++ b/packages/ti/sdo/ipc/MessageQ.c @@ -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; } diff --git a/packages/ti/sdo/utils/NameServer.c b/packages/ti/sdo/utils/NameServer.c index 55240be..8298c91 100644 --- a/packages/ti/sdo/utils/NameServer.c +++ b/packages/ti/sdo/utils/NameServer.c @@ -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; } -- 2.39.2