On Tue, May 14, 2024, at 13:08, Niklas Schnelle wrote: > In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at > compile time. We thus need to #ifdef functions and their callsites which > unconditionally use these I/O accessors. In the include/video/vga.h > these are conveniently all those functions with the vga_io_* prefix. > > Co-developed-by: Arnd Bergmann <arnd@xxxxxxxxxx> > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxxxx> > Signed-off-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx> > --- > Note: This patch does not depend any not-yet-mainline HAS_IOPORT changes > and may be merged via subsystem specific trees at your earliest > convenience. > > v1 -> v2: > - Moved vga_mm_r(), vga_mm_w(), vga_mm_w_fast() above #ifdef CONFIG_HAS_IOPORT > to use them in with or without I/O port variants. > - Duplicated vga_r(), vga_w(), vga_w_fast() functions as non-I/O port variants > to get rid of in-code #ifdef (Arnd) > - Got rid of if (regbase) logic inversion needed for in-code #ifdef Thanks for preparing the new version! > diff --git a/include/video/vga.h b/include/video/vga.h > index 947c0abd04ef..468764d6727a 100644 > --- a/include/video/vga.h > +++ b/include/video/vga.h > @@ -197,9 +197,26 @@ struct vgastate { > extern int save_vga(struct vgastate *state); > extern int restore_vga(struct vgastate *state); > > +static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned > short port) > +{ > + return readb (regbase + port); > +} My first thought was that this should use the normal whitespace, but I guess the file is pretty consistent about the style here, so I agree with your choice here. Arnd