Commit 05d3855b authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Arnd Bergmann

asm-generic/io.h: suppress endianness warnings for relaxed accessors

Copy the forced type casts from the normal MMIO accessors to suppress
the sparse warnings that point out __raw_readl() returns a native endian
word (just like readl()).
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent d564fa1f
...@@ -319,7 +319,7 @@ static inline u16 readw_relaxed(const volatile void __iomem *addr) ...@@ -319,7 +319,7 @@ static inline u16 readw_relaxed(const volatile void __iomem *addr)
u16 val; u16 val;
log_read_mmio(16, addr, _THIS_IP_, _RET_IP_); log_read_mmio(16, addr, _THIS_IP_, _RET_IP_);
val = __le16_to_cpu(__raw_readw(addr)); val = __le16_to_cpu((__le16 __force)__raw_readw(addr));
log_post_read_mmio(val, 16, addr, _THIS_IP_, _RET_IP_); log_post_read_mmio(val, 16, addr, _THIS_IP_, _RET_IP_);
return val; return val;
} }
...@@ -332,7 +332,7 @@ static inline u32 readl_relaxed(const volatile void __iomem *addr) ...@@ -332,7 +332,7 @@ static inline u32 readl_relaxed(const volatile void __iomem *addr)
u32 val; u32 val;
log_read_mmio(32, addr, _THIS_IP_, _RET_IP_); log_read_mmio(32, addr, _THIS_IP_, _RET_IP_);
val = __le32_to_cpu(__raw_readl(addr)); val = __le32_to_cpu((__le32 __force)__raw_readl(addr));
log_post_read_mmio(val, 32, addr, _THIS_IP_, _RET_IP_); log_post_read_mmio(val, 32, addr, _THIS_IP_, _RET_IP_);
return val; return val;
} }
...@@ -345,7 +345,7 @@ static inline u64 readq_relaxed(const volatile void __iomem *addr) ...@@ -345,7 +345,7 @@ static inline u64 readq_relaxed(const volatile void __iomem *addr)
u64 val; u64 val;
log_read_mmio(64, addr, _THIS_IP_, _RET_IP_); log_read_mmio(64, addr, _THIS_IP_, _RET_IP_);
val = __le64_to_cpu(__raw_readq(addr)); val = __le64_to_cpu((__le64 __force)__raw_readq(addr));
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;
} }
...@@ -366,7 +366,7 @@ static inline void writeb_relaxed(u8 value, volatile void __iomem *addr) ...@@ -366,7 +366,7 @@ static inline void writeb_relaxed(u8 value, volatile void __iomem *addr)
static inline void writew_relaxed(u16 value, volatile void __iomem *addr) static inline void writew_relaxed(u16 value, volatile void __iomem *addr)
{ {
log_write_mmio(value, 16, addr, _THIS_IP_, _RET_IP_); log_write_mmio(value, 16, addr, _THIS_IP_, _RET_IP_);
__raw_writew(cpu_to_le16(value), addr); __raw_writew((u16 __force)cpu_to_le16(value), addr);
log_post_write_mmio(value, 16, addr, _THIS_IP_, _RET_IP_); log_post_write_mmio(value, 16, addr, _THIS_IP_, _RET_IP_);
} }
#endif #endif
...@@ -376,7 +376,7 @@ static inline void writew_relaxed(u16 value, volatile void __iomem *addr) ...@@ -376,7 +376,7 @@ static inline void writew_relaxed(u16 value, volatile void __iomem *addr)
static inline void writel_relaxed(u32 value, volatile void __iomem *addr) static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
{ {
log_write_mmio(value, 32, addr, _THIS_IP_, _RET_IP_); log_write_mmio(value, 32, addr, _THIS_IP_, _RET_IP_);
__raw_writel(__cpu_to_le32(value), addr); __raw_writel((u32 __force)__cpu_to_le32(value), addr);
log_post_write_mmio(value, 32, addr, _THIS_IP_, _RET_IP_); log_post_write_mmio(value, 32, addr, _THIS_IP_, _RET_IP_);
} }
#endif #endif
...@@ -386,7 +386,7 @@ static inline void writel_relaxed(u32 value, volatile void __iomem *addr) ...@@ -386,7 +386,7 @@ static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
static inline void writeq_relaxed(u64 value, volatile void __iomem *addr) static inline void writeq_relaxed(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_);
__raw_writeq(__cpu_to_le64(value), addr); __raw_writeq((u64 __force)__cpu_to_le64(value), addr);
log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_); log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
} }
#endif #endif
......
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