mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
asm-generic/io.h: suppress endianness warnings for readq() and writeq()
[ Upstream commitd564fa1ff1] Commitc1d55d5013("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: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
925cbb7253
commit
69fdbb334d
@@ -190,7 +190,7 @@ static inline u64 readq(const volatile void __iomem *addr)
|
|||||||
u64 val;
|
u64 val;
|
||||||
|
|
||||||
__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);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ static inline void writel(u32 value, volatile void __iomem *addr)
|
|||||||
static inline void writeq(u64 value, volatile void __iomem *addr)
|
static inline void writeq(u64 value, volatile void __iomem *addr)
|
||||||
{
|
{
|
||||||
__io_bw();
|
__io_bw();
|
||||||
__raw_writeq(__cpu_to_le64(value), addr);
|
__raw_writeq((u64 __force)__cpu_to_le64(value), addr);
|
||||||
__io_aw();
|
__io_aw();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user