[PATCH v2 2/4] asm-generic: avoid compiler warnings due to PCI_IOBASE

Ahmad Fatoum ahmad at a3f.at
Sun Jan 29 23:27:05 PST 2023


Some GCC versions take offence at PCI_IOBASE's default value of 0.
Hide warnings about this.

Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
 include/asm-generic/io.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index acb70509d168..6e91c0aea68f 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -12,6 +12,7 @@
 #define __ASM_GENERIC_IO_H
 
 #include <linux/string.h> /* for memset() and memcpy() */
+#include <linux/compiler.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
@@ -86,7 +87,7 @@ static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
 #endif
 
 #ifndef PCI_IOBASE
-#define PCI_IOBASE ((void __iomem *)0)
+#define PCI_IOBASE ((void __iomem *)RELOC_HIDE((void *)0, 0))
 #endif
 
 #ifndef IO_SPACE_LIMIT
-- 
2.38.1




More information about the barebox mailing list