summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2015-11-04 04:27:22 +0100
committerJassi Brar <jaswinder.singh@linaro.org>2015-11-04 09:33:04 +0100
commitcb1ca0b3bb6681310e7fe9d29d6d4c76dd71801d (patch)
treeeefd6ab1f5a83007595753013d63d7085c0bc29d /drivers
parentmailbox: Off by one in mbox_test_message_read() (diff)
downloadlinux-cb1ca0b3bb6681310e7fe9d29d6d4c76dd71801d.tar.xz
linux-cb1ca0b3bb6681310e7fe9d29d6d4c76dd71801d.zip
mailbox: mailbox-test: avoid reading iomem twice
Don't pass mmio region as source to print_hex_dump() and then again to memcpy_fromio(). Do it once and give print_hex_dump() the buffer we just read the data in. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mailbox/mailbox-test.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index f82dc8926687..684ae17dcf39 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -221,11 +221,10 @@ static void mbox_test_receive_message(struct mbox_client *client, void *message)
spin_lock_irqsave(&tdev->lock, flags);
if (tdev->mmio) {
+ memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN);
print_hex_dump(KERN_INFO, "Client: Received [MMIO]: ",
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,
- __io_virt(tdev->mmio), MBOX_MAX_MSG_LEN, true);
- memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN);
-
+ tdev->rx_buffer, MBOX_MAX_MSG_LEN, true);
} else if (message) {
print_hex_dump(KERN_INFO, "Client: Received [API]: ",
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,