History

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

Commit c1d55d50139b ("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.

Vladimir Oltean committed 3 years ago

Commit d564fa11 parent fe15c261 file · +2 −2Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/asm-generic/io.h+2−2
@@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr) · 235 unmodified lines
236236
237237 log_read_mmio(64, addr, _THIS_IP_, _RET_IP_);
238238 __io_br();
239− val = __le64_to_cpu(__raw_readq(addr));
239+ val = __le64_to_cpu((__le64 __force)__raw_readq(addr));
240240 __io_ar(val);
241241 log_post_read_mmio(val, 64, addr, _THIS_IP_, _RET_IP_);
242242 return val;
@@ -287,7 +287,7 @@ static inline void writeq(u64 value, volatile void __iomem *addr) · 44 unmodified lines
287287 {
288288 log_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
289289 __io_bw();
290− __raw_writeq(__cpu_to_le64(value), addr);
290+ __raw_writeq((u64 __force)__cpu_to_le64(value), addr);
291291 __io_aw();
292292 log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
293293 }