linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: clk: Fix discarding const qualifier warning
@ 2020-01-07 12:26 Krzysztof Kozlowski
  2020-01-07 13:00 ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-07 12:26 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, linux-sh, linux-kernel; +Cc: Krzysztof Kozlowski

ioreadX() accepts pointer to non-const memory.  This fixes warnings
like:

    drivers/sh/clk/cpg.c: In function ‘r8’:
    drivers/sh/clk/cpg.c:41:17: warning: passing argument 1 of ‘ioread8’
        discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/sh/clk/cpg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index eeb028b9cdb3..4f3d99d37809 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -36,17 +36,17 @@ static void sh_clk_write(int value, struct clk *clk)
 		iowrite32(value, clk->mapped_reg);
 }
 
-static unsigned int r8(const void __iomem *addr)
+static unsigned int r8(void __iomem *addr)
 {
 	return ioread8(addr);
 }
 
-static unsigned int r16(const void __iomem *addr)
+static unsigned int r16(void __iomem *addr)
 {
 	return ioread16(addr);
 }
 
-static unsigned int r32(const void __iomem *addr)
+static unsigned int r32(void __iomem *addr)
 {
 	return ioread32(addr);
 }
@@ -55,7 +55,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
 {
 	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
 	if (clk->status_reg) {
-		unsigned int (*read)(const void __iomem *addr);
+		unsigned int (*read)(void __iomem *addr);
 		int i;
 		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
 			(phys_addr_t)clk->enable_reg + clk->mapped_reg;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-07 14:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 12:26 [PATCH] sh: clk: Fix discarding const qualifier warning Krzysztof Kozlowski
2020-01-07 13:00 ` Geert Uytterhoeven
2020-01-07 13:05   ` Krzysztof Kozlowski
2020-01-07 13:32     ` Krzysztof Kozlowski
2020-01-07 13:54       ` Arnd Bergmann
2020-01-07 14:04         ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).