Generic Linux architectural discussions
 help / color / mirror / Atom feed
* [PATCH] io: Fix return type of _inb and _inl
@ 2020-07-26  3:11 Stafford Horne
  2020-07-26  9:00 ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Stafford Horne @ 2020-07-26  3:11 UTC (permalink / raw)
  To: LKML; +Cc: Stafford Horne, Arnd Bergmann, Wei Xu, John Garry, linux-arch

The return type of functions _inb, _inw and _inl are all u16 which looks
wrong.  This patch makes them u8, u16 and u32 respectively.

The original commit text for these does not indicate that these should
be all forced to u16.

Fixes: f009c89df79a ("io: Provide _inX() and _outX()")
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 include/asm-generic/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 8b1e020e9a03..30a3aab312e6 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -456,7 +456,7 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer,
 
 #if !defined(inb) && !defined(_inb)
 #define _inb _inb
-static inline u16 _inb(unsigned long addr)
+static inline u8 _inb(unsigned long addr)
 {
 	u8 val;
 
@@ -482,7 +482,7 @@ static inline u16 _inw(unsigned long addr)
 
 #if !defined(inl) && !defined(_inl)
 #define _inl _inl
-static inline u16 _inl(unsigned long addr)
+static inline u32 _inl(unsigned long addr)
 {
 	u32 val;
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-27  8:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-26  3:11 [PATCH] io: Fix return type of _inb and _inl Stafford Horne
2020-07-26  9:00 ` Andy Shevchenko
2020-07-26 12:53   ` Stafford Horne
2020-07-27  8:04     ` Arnd Bergmann
2020-07-27  8:28       ` John Garry
2020-07-27  8:28         ` John Garry
2020-07-27  8:41         ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox