* [PATCH] m32r: fix readl/writel prototypes
@ 2018-01-02 10:56 Arnd Bergmann
2018-01-02 14:20 ` Geert Uytterhoeven
2018-01-02 21:52 ` Luc Van Oostenryck
0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-01-02 10:56 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-arch, Arnd Bergmann, linux-kernel
All other architectures use 'unsigned int' as the data in readl/write,
but m32r uses 'unsigned long', leading to lots of harmless build warnings
like:
drivers/mmc/host/dw_mmc.c: In function 'dw_mci_regs_show':
drivers/mmc/host/dw_mmc.c:168:31: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/m32r/include/asm/io.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
index 1b653bb16f9a..093486b5b931 100644
--- a/arch/m32r/include/asm/io.h
+++ b/arch/m32r/include/asm/io.h
@@ -108,9 +108,9 @@ static inline unsigned short _readw(unsigned long addr)
return *(volatile unsigned short __force *)addr;
}
-static inline unsigned long _readl(unsigned long addr)
+static inline unsigned int _readl(unsigned long addr)
{
- return *(volatile unsigned long __force *)addr;
+ return *(volatile unsigned int __force *)addr;
}
static inline void _writeb(unsigned char b, unsigned long addr)
@@ -123,9 +123,9 @@ static inline void _writew(unsigned short w, unsigned long addr)
*(volatile unsigned short __force *)addr = w;
}
-static inline void _writel(unsigned long l, unsigned long addr)
+static inline void _writel(unsigned long l, unsigned int addr)
{
- *(volatile unsigned long __force *)addr = l;
+ *(volatile unsigned int __force *)addr = l;
}
#define inb _inb
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] m32r: fix readl/writel prototypes
2018-01-02 10:56 [PATCH] m32r: fix readl/writel prototypes Arnd Bergmann
@ 2018-01-02 14:20 ` Geert Uytterhoeven
2018-01-02 14:20 ` Geert Uytterhoeven
2018-01-02 21:52 ` Luc Van Oostenryck
1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-01-02 14:20 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Andrew Morton, Linux-Arch, Linux Kernel Mailing List
Hi Arnd,
On Tue, Jan 2, 2018 at 11:56 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> All other architectures use 'unsigned int' as the data in readl/write,
> but m32r uses 'unsigned long', leading to lots of harmless build warnings
> like:
>
> drivers/mmc/host/dw_mmc.c: In function 'dw_mci_regs_show':
> drivers/mmc/host/dw_mmc.c:168:31: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
> seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
Thanks for fixing this!
BTW, I started fixing this a while ago, too, but of course I dived too deep
into arch/m32r/platforms/*/io.c (there are plenty of more type inconsistencies
with asm-generic/io.h!), and gave up after ca. 500 lines of changes ;-)
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
With the below fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> --- a/arch/m32r/include/asm/io.h
> +++ b/arch/m32r/include/asm/io.h
> @@ -108,9 +108,9 @@ static inline unsigned short _readw(unsigned long addr)
> return *(volatile unsigned short __force *)addr;
> }
>
> -static inline unsigned long _readl(unsigned long addr)
> +static inline unsigned int _readl(unsigned long addr)
> {
> - return *(volatile unsigned long __force *)addr;
> + return *(volatile unsigned int __force *)addr;
> }
>
> static inline void _writeb(unsigned char b, unsigned long addr)
> @@ -123,9 +123,9 @@ static inline void _writew(unsigned short w, unsigned long addr)
> *(volatile unsigned short __force *)addr = w;
> }
>
> -static inline void _writel(unsigned long l, unsigned long addr)
> +static inline void _writel(unsigned long l, unsigned int addr)
Don't you want to change the type of "l" instead of the type of "addr"?
> {
> - *(volatile unsigned long __force *)addr = l;
> + *(volatile unsigned int __force *)addr = l;
> }
Gr{oetje,eeting}s,
Geert
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] m32r: fix readl/writel prototypes
2018-01-02 14:20 ` Geert Uytterhoeven
@ 2018-01-02 14:20 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-01-02 14:20 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Andrew Morton, Linux-Arch, Linux Kernel Mailing List
Hi Arnd,
On Tue, Jan 2, 2018 at 11:56 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> All other architectures use 'unsigned int' as the data in readl/write,
> but m32r uses 'unsigned long', leading to lots of harmless build warnings
> like:
>
> drivers/mmc/host/dw_mmc.c: In function 'dw_mci_regs_show':
> drivers/mmc/host/dw_mmc.c:168:31: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
> seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
Thanks for fixing this!
BTW, I started fixing this a while ago, too, but of course I dived too deep
into arch/m32r/platforms/*/io.c (there are plenty of more type inconsistencies
with asm-generic/io.h!), and gave up after ca. 500 lines of changes ;-)
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
With the below fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> --- a/arch/m32r/include/asm/io.h
> +++ b/arch/m32r/include/asm/io.h
> @@ -108,9 +108,9 @@ static inline unsigned short _readw(unsigned long addr)
> return *(volatile unsigned short __force *)addr;
> }
>
> -static inline unsigned long _readl(unsigned long addr)
> +static inline unsigned int _readl(unsigned long addr)
> {
> - return *(volatile unsigned long __force *)addr;
> + return *(volatile unsigned int __force *)addr;
> }
>
> static inline void _writeb(unsigned char b, unsigned long addr)
> @@ -123,9 +123,9 @@ static inline void _writew(unsigned short w, unsigned long addr)
> *(volatile unsigned short __force *)addr = w;
> }
>
> -static inline void _writel(unsigned long l, unsigned long addr)
> +static inline void _writel(unsigned long l, unsigned int addr)
Don't you want to change the type of "l" instead of the type of "addr"?
> {
> - *(volatile unsigned long __force *)addr = l;
> + *(volatile unsigned int __force *)addr = l;
> }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] m32r: fix readl/writel prototypes
2018-01-02 10:56 [PATCH] m32r: fix readl/writel prototypes Arnd Bergmann
2018-01-02 14:20 ` Geert Uytterhoeven
@ 2018-01-02 21:52 ` Luc Van Oostenryck
2018-01-02 21:52 ` Luc Van Oostenryck
1 sibling, 1 reply; 5+ messages in thread
From: Luc Van Oostenryck @ 2018-01-02 21:52 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Andrew Morton, linux-arch, linux-kernel
On Tue, Jan 02, 2018 at 11:56:41AM +0100, Arnd Bergmann wrote:
> All other architectures use 'unsigned int' as the data in readl/write,
> but m32r uses 'unsigned long', leading to lots of harmless build warnings
> like:
>
> drivers/mmc/host/dw_mmc.c: In function 'dw_mci_regs_show':
> drivers/mmc/host/dw_mmc.c:168:31: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
> seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/m32r/include/asm/io.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
> index 1b653bb16f9a..093486b5b931 100644
> --- a/arch/m32r/include/asm/io.h
> +++ b/arch/m32r/include/asm/io.h
> @@ -108,9 +108,9 @@ static inline unsigned short _readw(unsigned long addr)
> return *(volatile unsigned short __force *)addr;
> }
>
> -static inline unsigned long _readl(unsigned long addr)
> +static inline unsigned int _readl(unsigned long addr)
> {
> - return *(volatile unsigned long __force *)addr;
> + return *(volatile unsigned int __force *)addr;
> }
The __force is not needed here, so I think it would be better to
remove it. Maybe better to do that in another patch, though.
-- Luc Van Oostenryck
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] m32r: fix readl/writel prototypes
2018-01-02 21:52 ` Luc Van Oostenryck
@ 2018-01-02 21:52 ` Luc Van Oostenryck
0 siblings, 0 replies; 5+ messages in thread
From: Luc Van Oostenryck @ 2018-01-02 21:52 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Andrew Morton, linux-arch, linux-kernel
On Tue, Jan 02, 2018 at 11:56:41AM +0100, Arnd Bergmann wrote:
> All other architectures use 'unsigned int' as the data in readl/write,
> but m32r uses 'unsigned long', leading to lots of harmless build warnings
> like:
>
> drivers/mmc/host/dw_mmc.c: In function 'dw_mci_regs_show':
> drivers/mmc/host/dw_mmc.c:168:31: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
> seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/m32r/include/asm/io.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
> index 1b653bb16f9a..093486b5b931 100644
> --- a/arch/m32r/include/asm/io.h
> +++ b/arch/m32r/include/asm/io.h
> @@ -108,9 +108,9 @@ static inline unsigned short _readw(unsigned long addr)
> return *(volatile unsigned short __force *)addr;
> }
>
> -static inline unsigned long _readl(unsigned long addr)
> +static inline unsigned int _readl(unsigned long addr)
> {
> - return *(volatile unsigned long __force *)addr;
> + return *(volatile unsigned int __force *)addr;
> }
The __force is not needed here, so I think it would be better to
remove it. Maybe better to do that in another patch, though.
-- Luc Van Oostenryck
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-02 21:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-02 10:56 [PATCH] m32r: fix readl/writel prototypes Arnd Bergmann
2018-01-02 14:20 ` Geert Uytterhoeven
2018-01-02 14:20 ` Geert Uytterhoeven
2018-01-02 21:52 ` Luc Van Oostenryck
2018-01-02 21:52 ` Luc Van Oostenryck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox