diff options
author | Eric <ewild@sysmocom.de> | 2020-05-06 10:54:36 +0200 |
---|---|---|
committer | Eric <ewild@sysmocom.de> | 2020-08-26 17:35:18 +0200 |
commit | 6f20791120f67963438fc106e9a660e8ab5ccfdf (patch) | |
tree | 9d4476f2b8380a8f43eea8f86c1d2901e7d75685 | |
parent | 2845dc741ccf8bce96657b52d32ab8479dc384ef (diff) |
shm: fix alignment
Change-Id: I8b593d792a992973e76dd19f7b678c9caa9c5e16
-rw-r--r-- | Transceiver52M/device/ipc/shm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Transceiver52M/device/ipc/shm.c b/Transceiver52M/device/ipc/shm.c index 33f2a4a..a99cd62 100644 --- a/Transceiver52M/device/ipc/shm.c +++ b/Transceiver52M/device/ipc/shm.c @@ -88,7 +88,7 @@ unsigned int ipc_shm_encode_smpl_buf(struct ipc_shm_raw_region *root_raw, struct { uint8_t *start = (uint8_t *)smpl_buf_raw; unsigned int offset = sizeof(struct ipc_shm_raw_smpl_buf); - offset += (((uintptr_t)offset + 7) & ~0x07ULL); + offset = (((uintptr_t)offset + 7) & ~0x07ULL); #ifdef ENCDECDEBUG fprintf(stderr, "encode: smpl_buf at offset %lu\n", (start - (uint8_t *)root_raw)); #endif @@ -102,7 +102,7 @@ unsigned int ipc_shm_encode_stream(struct ipc_shm_raw_region *root_raw, struct i unsigned int i; ptrdiff_t start = (ptrdiff_t)stream_raw; unsigned int offset = sizeof(struct ipc_shm_raw_stream) + sizeof(uint32_t) * num_buffers; - offset += (((uintptr_t)offset + 7) & ~0x07ULL); + offset = (((uintptr_t)offset + 7) & ~0x07ULL); #ifdef ENCDECDEBUG fprintf(stderr, "encode: stream at offset %lu\n", (start - (ptrdiff_t)root_raw)); #endif @@ -125,7 +125,7 @@ unsigned int ipc_shm_encode_channel(struct ipc_shm_raw_region *root_raw, struct { uint8_t *start = (uint8_t *)chan_raw; unsigned int offset = sizeof(struct ipc_shm_raw_channel); - offset += (((uintptr_t)offset + 7) & ~0x07ULL); + offset = (((uintptr_t)offset + 7) & ~0x07ULL); #ifdef ENCDECDEBUG fprintf(stderr, "encode: channel at offset %lu\n", (start - (uint8_t *)root_raw)); #endif @@ -146,7 +146,7 @@ unsigned int ipc_shm_encode_region(struct ipc_shm_raw_region *root_raw, uint32_t unsigned i; uintptr_t start = (uintptr_t)root_raw; unsigned int offset = sizeof(struct ipc_shm_raw_region) + sizeof(uint32_t) * num_chans; - offset += (((uintptr_t)offset + 7) & ~0x07ULL); + offset = (((uintptr_t)offset + 7) & ~0x07ULL); if (root_raw) root_raw->num_chans = num_chans; |