]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - packages/ti/sdo/ipc/transports/TransportShm.c
Prevent %-by-0 in Assert_isTrue() expressions
[ipc/ipcdev.git] / packages / ti / sdo / ipc / transports / TransportShm.c
index fa9c4b4f1d770450f39de794ce08e782d0611af0..b3475f915a0233246f95bbdcd3d0790e75845384 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -178,7 +178,8 @@ Int TransportShm_Instance_init(TransportShm_Object *obj,
                 ti_sdo_ipc_Ipc_A_addrNotInSharedRegion);
 
         /* 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),
                 ti_sdo_ipc_Ipc_A_addrNotCacheAligned);