[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220429135108.2781579-71-schnelle@linux.ibm.com>
Date: Fri, 29 Apr 2022 15:51:08 +0200
From: Niklas Schnelle <schnelle@...ux.ibm.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
linux-pci@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Alan Stern <stern@...land.harvard.edu>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...nel.org>
Subject: [RFC v2 39/39] asm-generic/io.h: drop inb() etc for HAS_IOPORT=n
With all subsystems and drivers either declaring their dependence on
HAS_IOPORT or ifdeffing I/O port specific code sections we can finally
make inb()/outb() and friends compile-time dependent on HAS_IOPORT as
suggested by Linus in the linked mail. The main benefit of this is that
on platforms such as s390 which have no meaningful way of implementing
inb()/outb() their use without the proper HAS_IOPORT dependency will
result in easy to catch and fix compile-time errors instead of compiling
code that can never work.
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/
Co-developed-by: Arnd Bergmann <arnd@...nel.org>
Signed-off-by: Niklas Schnelle <schnelle@...ux.ibm.com>
---
include/asm-generic/io.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 7ce93aaf69f8..b2572b2eab07 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -448,6 +448,7 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer,
#define IO_SPACE_LIMIT 0xffff
#endif
+#ifdef CONFIG_HAS_IOPORT
/*
* {in,out}{b,w,l}() access little endian I/O. {in,out}{b,w,l}_p() can be
* implemented on hardware that needs an additional delay for I/O accesses to
@@ -522,9 +523,12 @@ static inline void _outl(u32 value, unsigned long addr)
__io_paw();
}
#endif
+#endif /* CONFIG_HAS_IOPORT */
#include <linux/logic_pio.h>
+#ifdef CONFIG_HAS_IOPORT
+
#ifndef inb
#define inb _inb
#endif
@@ -703,6 +707,7 @@ static inline void outsl_p(unsigned long addr, const void *buffer,
outsl(addr, buffer, count);
}
#endif
+#endif /* CONFIG_HAS_IOPORT */
#ifndef CONFIG_GENERIC_IOMAP
#ifndef ioread8
--
2.32.0
Powered by blists - more mailing lists