Prevent %-by-0 in Assert_isTrue() expressions
[ipc/ipcdev.git] / packages / ti / sdo / ipc / nsremote / NameServerRemoteNotify.c
index 7cb60be807d1114a6a7006d421533442a979414a..5abac2cfa0418e8a9fc429da74e01880b0677e60 100644 (file)
@@ -102,12 +102,14 @@ Int NameServerRemoteNotify_Instance_init(NameServerRemoteNotify_Object *obj,
     obj->remoteState = NameServerRemoteNotify_IDLE;
 
     /* assert that sharedAddr is cache aligned */
-    Assert_isTrue(((UInt32)params->sharedAddr %
+    Assert_isTrue(SharedRegion_getCacheLineSize(obj->regionId) == 0 ||
+            ((UInt32)params->sharedAddr %
             SharedRegion_getCacheLineSize(obj->regionId) == 0),
             Ipc_A_addrNotCacheAligned);
 
     /* asset message structure size is cache aligned */
-    Assert_isTrue((sizeof(NameServerRemoteNotify_Message) %
+    Assert_isTrue(SharedRegion_getCacheLineSize(obj->regionId) == 0 ||
+            (sizeof(NameServerRemoteNotify_Message) %
             SharedRegion_getCacheLineSize(obj->regionId)) == 0,
             NameServerRemoteNotify_A_messageSize);