Skip to content

Commit 6afcb8b

Browse files
lucvoogregkh
authored andcommitted
alpha: fix annotation of io{read,write}{16,32}be()
[ Upstream commit bd72866 ] These accessors must be used to read/write a big-endian bus. The value returned or written is native-endian. However, these accessors are defined using be{16,32}_to_cpu() or cpu_to_be{16,32}() to make the endian conversion but these expect a __be{16,32} when none is present. Keeping them would need a force cast that would solve nothing at all. So, do the conversion using swab{16,32}, like done in asm-generic for similar situations. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Stephen Boyd <sboyd@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Link: http://lkml.kernel.org/r/20200622114232.80039-1-luc.vanoostenryck@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c90652a commit 6afcb8b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • arch/alpha/include/asm

arch/alpha/include/asm/io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
507507
}
508508
#endif
509509

510-
#define ioread16be(p) be16_to_cpu(ioread16(p))
511-
#define ioread32be(p) be32_to_cpu(ioread32(p))
512-
#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
513-
#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
510+
#define ioread16be(p) swab16(ioread16(p))
511+
#define ioread32be(p) swab32(ioread32(p))
512+
#define iowrite16be(v,p) iowrite16(swab16(v), (p))
513+
#define iowrite32be(v,p) iowrite32(swab32(v), (p))
514514

515515
#define inb_p inb
516516
#define inw_p inw

0 commit comments

Comments
 (0)