[msm] Update smem to be 8 byte align to match with everything around us
Change-Id: Ic9d60ca34f03726a5377cafe1ed864ab2fae7e02
CRs-Fixed: 245352
diff --git a/platform/msm_shared/smem.c b/platform/msm_shared/smem.c
index 1d05597..63df5c3 100644
--- a/platform/msm_shared/smem.c
+++ b/platform/msm_shared/smem.c
@@ -35,7 +35,7 @@
static struct smem *smem = (void *)(MSM_SHARED_BASE);
-/* buf MUST be 4byte aligned, and len MUST be a multiple of 4. */
+/* buf MUST be 4byte aligned, and len MUST be a multiple of 8. */
unsigned smem_read_alloc_entry(smem_mem_type_t type, void *buf, int len)
{
struct smem_alloc_info *ainfo;
@@ -54,11 +54,13 @@
if (readl(&ainfo->allocated) == 0)
return 1;
- if ((size = readl(&ainfo->size)) != (unsigned)len)
+ size = readl(&ainfo->size);
+
+ if (size != (unsigned)((len + 7) & ~0x00000007))
return 1;
src = MSM_SHARED_BASE + readl(&ainfo->offset);
- for (; size > 0; src += 4, size -= 4)
+ for (; len > 0; src += 4, len -= 4)
*(dest++) = readl(src);
return 0;