mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-29 10:34:08 +00:00
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>
This commit is contained in:
parent
c3ac54a6f5
commit
cb1ca0b3bb
1 changed files with 2 additions and 3 deletions
|
@ -221,11 +221,10 @@ static void mbox_test_receive_message(struct mbox_client *client, void *message)
|
||||||
|
|
||||||
spin_lock_irqsave(&tdev->lock, flags);
|
spin_lock_irqsave(&tdev->lock, flags);
|
||||||
if (tdev->mmio) {
|
if (tdev->mmio) {
|
||||||
|
memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN);
|
||||||
print_hex_dump(KERN_INFO, "Client: Received [MMIO]: ",
|
print_hex_dump(KERN_INFO, "Client: Received [MMIO]: ",
|
||||||
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,
|
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,
|
||||||
__io_virt(tdev->mmio), MBOX_MAX_MSG_LEN, true);
|
tdev->rx_buffer, MBOX_MAX_MSG_LEN, true);
|
||||||
memcpy_fromio(tdev->rx_buffer, tdev->mmio, MBOX_MAX_MSG_LEN);
|
|
||||||
|
|
||||||
} else if (message) {
|
} else if (message) {
|
||||||
print_hex_dump(KERN_INFO, "Client: Received [API]: ",
|
print_hex_dump(KERN_INFO, "Client: Received [API]: ",
|
||||||
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,
|
DUMP_PREFIX_ADDRESS, MBOX_BYTES_PER_LINE, 1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue