* [PATCH] mailbox: mailbox-test: avoid reading iomem twice
@ 2015-11-04 4:07 jaswinder.singh
2015-11-04 8:16 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: jaswinder.singh @ 2015-11-04 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: lee.jones, sfr, Jassi Brar
From: Jassi Brar <jaswinder.singh@linaro.org>
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.
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
---
drivers/mailbox/mailbox-test.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index f82dc89..684ae17 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,
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mailbox: mailbox-test: avoid reading iomem twice
2015-11-04 4:07 [PATCH] mailbox: mailbox-test: avoid reading iomem twice jaswinder.singh
@ 2015-11-04 8:16 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2015-11-04 8:16 UTC (permalink / raw)
To: jaswinder.singh; +Cc: linux-kernel, sfr
On Wed, 04 Nov 2015, jaswinder.singh@linaro.org wrote:
> From: Jassi Brar <jaswinder.singh@linaro.org>
>
> 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.
>
> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
> ---
> drivers/mailbox/mailbox-test.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Nice fix Jassi.
Acked-by: Lee Jones <lee.jones@linaro.org>
> diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
> index f82dc89..684ae17 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,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-04 8:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 4:07 [PATCH] mailbox: mailbox-test: avoid reading iomem twice jaswinder.singh
2015-11-04 8:16 ` Lee Jones
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.