From cbdd0e78ab180e0287c4c26e970cfe751ee6ede4 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Fri, 26 Apr 2019 01:54:12 +0200 Subject: [PATCH] mailbox: fix dst size of mailbox write functions Fixes destination size used by mailbox write functions. Subtraction of the base address shouldn't be part of this size calculation. Signed-off-by: Tomasz Lauda --- src/include/sof/mailbox.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/include/sof/mailbox.h b/src/include/sof/mailbox.h index af8af01fa97d..c71c20bd659e 100644 --- a/src/include/sof/mailbox.h +++ b/src/include/sof/mailbox.h @@ -74,8 +74,7 @@ static inline void mailbox_dspbox_write(size_t offset, const void *src, size_t bytes) { assert(!memcpy_s((void *)(MAILBOX_DSPBOX_BASE + offset), - MAILBOX_DSPBOX_SIZE - offset - MAILBOX_DSPBOX_BASE, - src, bytes)); + MAILBOX_DSPBOX_SIZE - offset, src, bytes)); dcache_writeback_region((void *)(MAILBOX_DSPBOX_BASE + offset), bytes); } @@ -93,8 +92,7 @@ static inline void mailbox_hostbox_write(size_t offset, const void *src, size_t bytes) { assert(!memcpy_s((void *)(MAILBOX_HOSTBOX_BASE + offset), - MAILBOX_HOSTBOX_SIZE - offset - MAILBOX_HOSTBOX_BASE, - src, bytes)); + MAILBOX_HOSTBOX_SIZE - offset, src, bytes)); dcache_writeback_region((void *)(MAILBOX_HOSTBOX_BASE + offset), bytes); } @@ -112,8 +110,7 @@ static inline void mailbox_stream_write(size_t offset, const void *src, size_t bytes) { assert(!memcpy_s((void *)(MAILBOX_STREAM_BASE + offset), - MAILBOX_STREAM_SIZE - offset - MAILBOX_STREAM_BASE, - src, bytes)); + MAILBOX_STREAM_SIZE - offset, src, bytes)); dcache_writeback_region((void *)(MAILBOX_STREAM_BASE + offset), bytes); }