Skip to content

Commit a8e3943

Browse files
morimototorvalds
authored andcommitted
sh: clkfwk: remove r8/r16/r32
SH will get below warning ${LINUX}/drivers/sh/clk/cpg.c: In function 'r8': ${LINUX}/drivers/sh/clk/cpg.c:41:17: warning: passing argument 1 of 'ioread8' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] return ioread8(addr); ^~~~ In file included from ${LINUX}/arch/sh/include/asm/io.h:21, from ${LINUX}/include/linux/io.h:13, from ${LINUX}/drivers/sh/clk/cpg.c:14: ${LINUX}/include/asm-generic/iomap.h:29:29: note: expected 'void *' but argument is of type 'const void *' extern unsigned int ioread8(void __iomem *); ^~~~~~~~~~~~~~ We don't need "const" for r8/r16/r32. And we don't need r8/r16/r32 themselvs. This patch cleanup these. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Alan Modra <[email protected]> Cc: Bin Meng <[email protected]> Cc: Chen Zhou <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Rich Felker <[email protected]> Cc: Romain Naour <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Yoshinori Sato <[email protected]> X-MARC-Message: https://marc.info/?l=linux-renesas-soc&m=157852973916903 Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7f897ac commit a8e3943

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

drivers/sh/clk/cpg.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,21 @@ static void sh_clk_write(int value, struct clk *clk)
3636
iowrite32(value, clk->mapped_reg);
3737
}
3838

39-
static unsigned int r8(const void __iomem *addr)
40-
{
41-
return ioread8(addr);
42-
}
43-
44-
static unsigned int r16(const void __iomem *addr)
45-
{
46-
return ioread16(addr);
47-
}
48-
49-
static unsigned int r32(const void __iomem *addr)
50-
{
51-
return ioread32(addr);
52-
}
53-
5439
static int sh_clk_mstp_enable(struct clk *clk)
5540
{
5641
sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
5742
if (clk->status_reg) {
58-
unsigned int (*read)(const void __iomem *addr);
43+
unsigned int (*read)(void __iomem *addr);
5944
int i;
6045
void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
6146
(phys_addr_t)clk->enable_reg + clk->mapped_reg;
6247

6348
if (clk->flags & CLK_ENABLE_REG_8BIT)
64-
read = r8;
49+
read = ioread8;
6550
else if (clk->flags & CLK_ENABLE_REG_16BIT)
66-
read = r16;
51+
read = ioread16;
6752
else
68-
read = r32;
53+
read = ioread32;
6954

7055
for (i = 1000;
7156
(read(mapped_status) & (1 << clk->enable_bit)) && i;

0 commit comments

Comments
 (0)