[lkml]   [2022]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 37/37] 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.

Co-developed-by: Arnd Bergmann <>
Signed-off-by: Niklas Schnelle <>
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

* {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)
+#endif /* CONFIG_HAS_IOPORT */

#include <linux/logic_pio.h>

#ifndef inb
#define inb _inb
@@ -703,6 +707,7 @@ static inline void outsl_p(unsigned long addr, const void *buffer,
outsl(addr, buffer, count);
+#endif /* CONFIG_HAS_IOPORT */

#ifndef ioread8
 \ /
  Last update: 2022-04-29 15:56    [W:0.357 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site