public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH] m68k: Fix VGA I/O defines
@ 2025-01-07  9:58 Thomas Zimmermann
  2025-01-08 16:23 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Zimmermann @ 2025-01-07  9:58 UTC (permalink / raw)
  To: geert
  Cc: linux-m68k, linux-kernel, Thomas Zimmermann, kernel test robot,
	linux-fbdev, dri-devel, Helge Deller, stable

Including m86k's <asm/raw_io.h> in vga.h on nommu platforms results
in conflicting defines with io_no.h for various I/O macros from the
__raw_read and __raw_write families. An example error is

   In file included from arch/m68k/include/asm/vga.h:12,
                 from include/video/vga.h:22,
                 from include/linux/vgaarb.h:34,
		 from drivers/video/aperture.c:12:
>> arch/m68k/include/asm/raw_io.h:39: warning: "__raw_readb" redefined
      39 | #define __raw_readb in_8
	 |
   In file included from arch/m68k/include/asm/io.h:6,
		    from include/linux/io.h:13,
		    from include/linux/irq.h:20,
		    from include/asm-generic/hardirq.h:17,
		    from ./arch/m68k/include/generated/asm/hardirq.h:1,
		    from include/linux/hardirq.h:11,
		    from include/linux/interrupt.h:11,
                    from include/linux/trace_recursion.h:5,
		    from include/linux/ftrace.h:10,
		    from include/linux/kprobes.h:28,
		    from include/linux/kgdb.h:19,
		    from include/linux/fb.h:6,
		    from drivers/video/aperture.c:5:
   arch/m68k/include/asm/io_no.h:16: note: this is the location of the previous definition
      16 | #define __raw_readb(addr) \
	 |

Include <asm/io.h>, which avoid raw_io.h on nommu platforms. Also change
the defined values of some of the read/write symbols in vga.h to
__raw_read/__raw_write as the raw_in/raw_out symbols are not generally
available.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501071629.DNEswlm8-lkp@intel.com/
Fixes: 5c3f968712ce ("m68k/video: Create <asm/vga.h>")
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v3.5+
---
 arch/m68k/include/asm/vga.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/include/asm/vga.h b/arch/m68k/include/asm/vga.h
index 4742e6bc3ab8..cdd414fa8710 100644
--- a/arch/m68k/include/asm/vga.h
+++ b/arch/m68k/include/asm/vga.h
@@ -9,7 +9,7 @@
  */
 #ifndef CONFIG_PCI
 
-#include <asm/raw_io.h>
+#include <asm/io.h>
 #include <asm/kmap.h>
 
 /*
@@ -29,9 +29,9 @@
 #define inw_p(port)		0
 #define outb_p(port, val)	do { } while (0)
 #define outw(port, val)		do { } while (0)
-#define readb			raw_inb
-#define writeb			raw_outb
-#define writew			raw_outw
+#define readb			__raw_readb
+#define writeb			__raw_writeb
+#define writew			__raw_writew
 
 #endif /* CONFIG_PCI */
 #endif /* _ASM_M68K_VGA_H */
-- 
2.47.1


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

* Re: [PATCH] m68k: Fix VGA I/O defines
  2025-01-07  9:58 [PATCH] m68k: Fix VGA I/O defines Thomas Zimmermann
@ 2025-01-08 16:23 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2025-01-08 16:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: linux-m68k, linux-kernel, kernel test robot, linux-fbdev,
	dri-devel, Helge Deller, stable

Hi Thomas,

On Tue, Jan 7, 2025 at 10:59 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Including m86k's <asm/raw_io.h> in vga.h on nommu platforms results
> in conflicting defines with io_no.h for various I/O macros from the
> __raw_read and __raw_write families. An example error is
>
>    In file included from arch/m68k/include/asm/vga.h:12,
>                  from include/video/vga.h:22,
>                  from include/linux/vgaarb.h:34,
>                  from drivers/video/aperture.c:12:
> >> arch/m68k/include/asm/raw_io.h:39: warning: "__raw_readb" redefined
>       39 | #define __raw_readb in_8
>          |
>    In file included from arch/m68k/include/asm/io.h:6,
>                     from include/linux/io.h:13,
>                     from include/linux/irq.h:20,
>                     from include/asm-generic/hardirq.h:17,
>                     from ./arch/m68k/include/generated/asm/hardirq.h:1,
>                     from include/linux/hardirq.h:11,
>                     from include/linux/interrupt.h:11,
>                     from include/linux/trace_recursion.h:5,
>                     from include/linux/ftrace.h:10,
>                     from include/linux/kprobes.h:28,
>                     from include/linux/kgdb.h:19,
>                     from include/linux/fb.h:6,
>                     from drivers/video/aperture.c:5:
>    arch/m68k/include/asm/io_no.h:16: note: this is the location of the previous definition
>       16 | #define __raw_readb(addr) \
>          |
>
> Include <asm/io.h>, which avoid raw_io.h on nommu platforms. Also change
> the defined values of some of the read/write symbols in vga.h to
> __raw_read/__raw_write as the raw_in/raw_out symbols are not generally
> available.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501071629.DNEswlm8-lkp@intel.com/
> Fixes: 5c3f968712ce ("m68k/video: Create <asm/vga.h>")
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-fbdev@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: Helge Deller <deller@gmx.de>
> Cc: <stable@vger.kernel.org> # v3.5+

Thanks for your patch!

> --- a/arch/m68k/include/asm/vga.h
> +++ b/arch/m68k/include/asm/vga.h
> @@ -9,7 +9,7 @@
>   */
>  #ifndef CONFIG_PCI
>
> -#include <asm/raw_io.h>
> +#include <asm/io.h>

It definitely makes sense to include <asm/io.h> instead of
<asm/raw_io.h> in this file.

>  #include <asm/kmap.h>
>
>  /*
> @@ -29,9 +29,9 @@
>  #define inw_p(port)            0
>  #define outb_p(port, val)      do { } while (0)
>  #define outw(port, val)                do { } while (0)
> -#define readb                  raw_inb
> -#define writeb                 raw_outb
> -#define writew                 raw_outw
> +#define readb                  __raw_readb
> +#define writeb                 __raw_writeb
> +#define writew                 __raw_writew

OK

>
>  #endif /* CONFIG_PCI */
>  #endif /* _ASM_M68K_VGA_H */

I gave it a try on various configs, and inspected the impact
(none, except for killing the warnings), so
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k tree for v6.14.

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] 2+ messages in thread

end of thread, other threads:[~2025-01-08 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07  9:58 [PATCH] m68k: Fix VGA I/O defines Thomas Zimmermann
2025-01-08 16:23 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox