diff options
author | John Stultz <john.stultz@linaro.org> | 2020-03-03 06:35:48 +0000 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2020-03-17 04:10:56 +0000 |
commit | 0b3c9bba428563ffcc725c240b462fd50f97d45d (patch) | |
tree | a63630427885e90853917e0b867978907a387ce7 /qcom/rmtfs | |
parent | 26656699221106398142c006c531eead7f616bbb (diff) |
db845c: qcom: Fix pointer arithmetic warnings.
Building the qcom tools, we see a lot of the following:
warning: arithmetic on a pointer to void is a GNU extension
Fix this by casting the void* ptrs to char* when doing pointer
arithmatic.
Change-Id: Id2b0098388406bfc434ee01344a39e3413cb281c
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'qcom/rmtfs')
-rw-r--r-- | qcom/rmtfs/sharedmem.c | 2 | ||||
-rw-r--r-- | qcom/rmtfs/storage.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/qcom/rmtfs/sharedmem.c b/qcom/rmtfs/sharedmem.c index a1301da..b6d3279 100644 --- a/qcom/rmtfs/sharedmem.c +++ b/qcom/rmtfs/sharedmem.c @@ -348,7 +348,7 @@ static void *rmtfs_mem_ptr(struct rmtfs_mem *rmem, unsigned long phys_address, s if (start < rmem->address || end > rmem->address + rmem->size) return NULL; - return rmem->base + phys_address - rmem->address; + return (char*)rmem->base + phys_address - rmem->address; } ssize_t rmtfs_mem_read(struct rmtfs_mem *rmem, unsigned long phys_address, void *buf, ssize_t len) diff --git a/qcom/rmtfs/storage.c b/qcom/rmtfs/storage.c index 4c78ab3..c8e69ed 100644 --- a/qcom/rmtfs/storage.c +++ b/qcom/rmtfs/storage.c @@ -203,13 +203,13 @@ ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t } else { n = MIN(nbyte, rmtfd->shadow_len - offset); if (n > 0) - memcpy(buf, rmtfd->shadow_buf + offset, n); + memcpy(buf, (char*)rmtfd->shadow_buf + offset, n); else n = 0; } if (n < nbyte) - memset(buf + n, 0, nbyte - n); + memset((char*)buf + n, 0, nbyte - n); return nbyte; } @@ -239,7 +239,7 @@ ssize_t storage_pwrite(struct rmtfd *rmtfd, const void *buf, size_t nbyte, off_t rmtfd->shadow_len = new_len; } - memcpy(rmtfd->shadow_buf + offset, buf, nbyte); + memcpy((char*)rmtfd->shadow_buf + offset, buf, nbyte); return nbyte; } |