[1/5] m68k/io: Add missing ioremap define guards, fix typo
diff mbox series

Message ID 20180702133532.5412-2-geert@linux-m68k.org
State New, archived
Headers show
Series
  • m68k: IO Fixes and Cleanups
Related show

Commit Message

Geert Uytterhoeven July 2, 2018, 1:35 p.m. UTC
- Add missing define guard for ioremap_wt(),
  - Fix typo s/ioremap_fillcache/ioremap_fullcache/,
  - Add define guard for iounmap() for consistency with other
    architectures.

Fixes: 9746882f547d2f00 ("m68k: group io mapping definitions and functions")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/kmap.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Greg Ungerer July 3, 2018, 2:13 a.m. UTC | #1
Hi Geert,

On 02/07/18 23:35, Geert Uytterhoeven wrote:
>    - Add missing define guard for ioremap_wt(),
>    - Fix typo s/ioremap_fillcache/ioremap_fullcache/,
>    - Add define guard for iounmap() for consistency with other
>      architectures.
> 
> Fixes: 9746882f547d2f00 ("m68k: group io mapping definitions and functions")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

If I build for the m5475evb defconfig then I get warnings like this:

   CC      init/main.o
In file included from ./include/asm-generic/io.h:19:0,
                  from ./arch/m68k/include/asm/io_no.h:147,
                  from ./arch/m68k/include/asm/io.h:3,
                  from ./include/linux/bio.h:28,
                  from ./include/linux/blkdev.h:21,
                  from init/main.c:80:
./include/asm-generic/iomap.h:79:0: warning: "ioremap_wt" redefined
  #define ioremap_wt ioremap_nocache
  ^
In file included from ./arch/m68k/include/asm/io_no.h:145:0,
                  from ./arch/m68k/include/asm/io.h:3,
                  from ./include/linux/bio.h:28,
                  from ./include/linux/blkdev.h:21,
                  from init/main.c:80:
./arch/m68k/include/asm/kmap.h:37:0: note: this is the location of the previous definition
  #define ioremap_wt ioremap_wt
  ^

Regards
Greg


> ---
>   arch/m68k/include/asm/kmap.h | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/m68k/include/asm/kmap.h b/arch/m68k/include/asm/kmap.h
> index 84b8333db8ad1987..bf1026def698f21f 100644
> --- a/arch/m68k/include/asm/kmap.h
> +++ b/arch/m68k/include/asm/kmap.h
> @@ -16,6 +16,7 @@
>    */
>   extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
>   			       int cacheflag);
> +#define iounmap iounmap
>   extern void iounmap(void __iomem *addr);
>   extern void __iounmap(void *addr, unsigned long size);
>   
> @@ -33,13 +34,14 @@ static inline void __iomem *ioremap_nocache(unsigned long physaddr,
>   }
>   
>   #define ioremap_uc ioremap_nocache
> +#define ioremap_wt ioremap_wt
>   static inline void __iomem *ioremap_wt(unsigned long physaddr,
>   				       unsigned long size)
>   {
>   	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
>   }
>   
> -#define ioremap_fillcache ioremap_fullcache
> +#define ioremap_fullcache ioremap_fullcache
>   static inline void __iomem *ioremap_fullcache(unsigned long physaddr,
>   					      unsigned long size)
>   {
>
Geert Uytterhoeven July 3, 2018, 7:41 a.m. UTC | #2
Hi Greg,

On Tue, Jul 3, 2018 at 4:13 AM Greg Ungerer <gerg@linux-m68k.org> wrote:
> On 02/07/18 23:35, Geert Uytterhoeven wrote:
> >    - Add missing define guard for ioremap_wt(),
> >    - Fix typo s/ioremap_fillcache/ioremap_fullcache/,
> >    - Add define guard for iounmap() for consistency with other
> >      architectures.
> >
> > Fixes: 9746882f547d2f00 ("m68k: group io mapping definitions and functions")
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> If I build for the m5475evb defconfig then I get warnings like this:
>
>    CC      init/main.o
> In file included from ./include/asm-generic/io.h:19:0,
>                   from ./arch/m68k/include/asm/io_no.h:147,
>                   from ./arch/m68k/include/asm/io.h:3,
>                   from ./include/linux/bio.h:28,
>                   from ./include/linux/blkdev.h:21,
>                   from init/main.c:80:
> ./include/asm-generic/iomap.h:79:0: warning: "ioremap_wt" redefined
>   #define ioremap_wt ioremap_nocache
>   ^
> In file included from ./arch/m68k/include/asm/io_no.h:145:0,
>                   from ./arch/m68k/include/asm/io.h:3,
>                   from ./include/linux/bio.h:28,
>                   from ./include/linux/blkdev.h:21,
>                   from init/main.c:80:
> ./arch/m68k/include/asm/kmap.h:37:0: note: this is the location of the previous definition
>   #define ioremap_wt ioremap_wt
>   ^

Thanks, I did some m68knommu compile tests, but didn't see this warning, which
happens for Coldfire+MMU only.

The issue is that there are two ways to declare an architecture has
ioremap_wt():
  1. By defining ioremap_wt,
  2. By defining ARCH_HAS_IOREMAP_WT.

1 is done in arch/m68k/include/asm/kmap.h.
2 is done in arch/m68k/include/asm/io_mm.h. Moving that to kmap.h fixes
the warning. Will send an update shortly.

Gr{oetje,eeting}s,

                        Geert

Patch
diff mbox series

diff --git a/arch/m68k/include/asm/kmap.h b/arch/m68k/include/asm/kmap.h
index 84b8333db8ad1987..bf1026def698f21f 100644
--- a/arch/m68k/include/asm/kmap.h
+++ b/arch/m68k/include/asm/kmap.h
@@ -16,6 +16,7 @@ 
  */
 extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
 			       int cacheflag);
+#define iounmap iounmap
 extern void iounmap(void __iomem *addr);
 extern void __iounmap(void *addr, unsigned long size);
 
@@ -33,13 +34,14 @@  static inline void __iomem *ioremap_nocache(unsigned long physaddr,
 }
 
 #define ioremap_uc ioremap_nocache
+#define ioremap_wt ioremap_wt
 static inline void __iomem *ioremap_wt(unsigned long physaddr,
 				       unsigned long size)
 {
 	return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
 }
 
-#define ioremap_fillcache ioremap_fullcache
+#define ioremap_fullcache ioremap_fullcache
 static inline void __iomem *ioremap_fullcache(unsigned long physaddr,
 					      unsigned long size)
 {