From: Al Viro viro@zeniv.linux.org.uk
[ Upstream commit 7205ef77dfe167df1b83aea28cf00fc02d662990 ]
Conventions for readsl() are the same as for readl() - any __iomem pointer is acceptable, both const and volatile ones being OK. Same for readsb() and readsw().
Signed-off-by: Al Viro viro@zeniv.linux.org.uk Reviewed-by: Andreas Larsson andreas@gaisler.com Signed-off-by: Andreas Larsson andreas@gaisler.com # Making sparc64 subject prefix Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES - `arch/sparc/include/asm/io_64.h:253`, `:259`, `:265` now declare `readsb/readsw/readsl` with `const volatile void __iomem *` so callers keep their `const`/`volatile` qualifiers. Without this, every sparc build that uses the standard helpers via `ioread{8,16,32}_rep()` (see `arch/sparc/include/asm/io_64.h:289-291`) forces a qualifier drop, which becomes a hard build failure whenever `CONFIG_WERROR` or `make W=1` is enabled. - The rest of the kernel already advertises these helpers as taking const-qualified pointers (for example `lib/iomap.c:360-372` and the asm-generic helpers), so sparc was the outlier. Aligning the prototypes removes that API mismatch and stops downstream drivers from needing casts/workarounds when built for sparc64. - Risk is negligible: the bodies still just hand the pointer to `ins[blw]()` after an `unsigned long __force` cast, so runtime behavior is unchanged while the compiler interface is fixed. Given it repairs a real build breakage for standard warning-as-error configurations with effectively zero regression surface, it’s a good stable backport candidate.
arch/sparc/include/asm/io_64.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index c9528e4719cd2..d8ed296624afd 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -250,19 +250,19 @@ void insl(unsigned long, void *, unsigned long); #define insw insw #define insl insl
-static inline void readsb(void __iomem *port, void *buf, unsigned long count) +static inline void readsb(const volatile void __iomem *port, void *buf, unsigned long count) { insb((unsigned long __force)port, buf, count); } #define readsb readsb
-static inline void readsw(void __iomem *port, void *buf, unsigned long count) +static inline void readsw(const volatile void __iomem *port, void *buf, unsigned long count) { insw((unsigned long __force)port, buf, count); } #define readsw readsw
-static inline void readsl(void __iomem *port, void *buf, unsigned long count) +static inline void readsl(const volatile void __iomem *port, void *buf, unsigned long count) { insl((unsigned long __force)port, buf, count); }