Commit d564fa1f authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Arnd Bergmann

asm-generic/io.h: suppress endianness warnings for readq() and writeq()

Commit c1d55d50 ("asm-generic/io.h: Fix sparse warnings on
big-endian architectures") missed fixing the 64-bit accessors.

Arnd explains in the attached link why the casts are necessary, even if
__raw_readq() and __raw_writeq() do not take endian-specific types.

Link: https://lore.kernel.org/lkml/9105d6fc-880b-4734-857d-e3d30b87ccf6@app.fastmail.com/Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent fe15c26e
...@@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr) ...@@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr)
log_read_mmio(64, addr, _THIS_IP_, _RET_IP_); log_read_mmio(64, addr, _THIS_IP_, _RET_IP_);
__io_br(); __io_br();
val = __le64_to_cpu(__raw_readq(addr)); val = __le64_to_cpu((__le64 __force)__raw_readq(addr));
__io_ar(val); __io_ar(val);
log_post_read_mmio(val, 64, addr, _THIS_IP_, _RET_IP_); log_post_read_mmio(val, 64, addr, _THIS_IP_, _RET_IP_);
return val; return val;
...@@ -287,7 +287,7 @@ static inline void writeq(u64 value, volatile void __iomem *addr) ...@@ -287,7 +287,7 @@ static inline void writeq(u64 value, volatile void __iomem *addr)
{ {
log_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_); log_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
__io_bw(); __io_bw();
__raw_writeq(__cpu_to_le64(value), addr); __raw_writeq((u64 __force)__cpu_to_le64(value), addr);
__io_aw(); __io_aw();
log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_); log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment