Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -3
+2 -3
drivers/mailbox/mailbox-test.c
··· 221 221 222 222 spin_lock_irqsave(&tdev->lock, flags); 223 223 if (tdev->mmio) { 224 + memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN); 224 225 print_hex_dump(KERN_INFO, "Client: Received [MMIO]: ", 225 226 DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1, 226 - __io_virt(tdev->mmio), MBOX_MAX_MSG_LEN, true); 227 - memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN); 228 - 227 + tdev->rx_buffer, MBOX_MAX_MSG_LEN, true); 229 228 } else if (message) { 230 229 print_hex_dump(KERN_INFO, "Client: Received [API]: ", 231 230 DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,