Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254977

[PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of open-coding it

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of open-coding it
Date 2015-10-23 22:10 +0200
Message-ID <qmQOZ-3lW-11@gated-at.bofh.it> (permalink)
References <qmQOZ-3lW-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now that we have a generic library function for this, replace the
open-coded instance.

Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/soc/qcom/smd.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/qcom/smd.c b/drivers/soc/qcom/smd.c
index 86b598cff91a..498fd0581a45 100644
--- a/drivers/soc/qcom/smd.c
+++ b/drivers/soc/qcom/smd.c
@@ -434,20 +434,15 @@ static void smd_copy_to_fifo(void __iomem *dst,
 /*
  * Copy count bytes of data using 32bit accesses, if that is required.
  */
-static void smd_copy_from_fifo(void *_dst,
-			       const void __iomem *_src,
+static void smd_copy_from_fifo(void *dst,
+			       const void __iomem *src,
 			       size_t count,
 			       bool word_aligned)
 {
-	u32 *dst = (u32 *)_dst;
-	u32 *src = (u32 *)_src;
-
 	if (word_aligned) {
-		count /= sizeof(u32);
-		while (count--)
-			*dst++ = __raw_readl(src++);
+		__ioread32_copy(dst, src, count / sizeof(u32));
 	} else {
-		memcpy_fromio(_dst, _src, count);
+		memcpy_fromio(dst, src, count);
 	}
 }
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/4] Add __ioread32_copy() and use it Stephen Boyd <sboyd@codeaurora.org> - 2015-10-23 22:10 +0200
  [PATCH v3 2/4] lib: iomap_copy: Add __ioread32_copy() Stephen Boyd <sboyd@codeaurora.org> - 2015-10-23 22:10 +0200
  [PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of open-coding it Stephen Boyd <sboyd@codeaurora.org> - 2015-10-23 22:10 +0200
    Re: [PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of  open-coding it Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-10-23 22:30 +0200
    Re: [PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of  open-coding it Andy Gross <agross@codeaurora.org> - 2015-10-26 03:10 +0100
  [PATCH v3 4/4] FIRMWARE: bcm47xx_nvram: Use __ioread32_copy() instead of open-coding Stephen Boyd <sboyd@codeaurora.org> - 2015-10-23 22:10 +0200
  [PATCH v3 1/4] frv: io: Accept const void pointers for read{b,w,l}() Stephen Boyd <sboyd@codeaurora.org> - 2015-10-23 22:10 +0200

csiph-web