提交 45173890 编写于 作者: H Horia Geantă 提交者: Greg Kroah-Hartman

crypto: caam - fix implicit casts in endianness helpers

[ Upstream commit aae733a3f46f5ef338fbdde26e14cbb205a23de0 ]

Fix the following sparse endianness warnings:

drivers/crypto/caam/regs.h:95:1: sparse: incorrect type in return expression (different base types) @@    expected unsigned int @@    got restricted __le32unsigned int @@
drivers/crypto/caam/regs.h:95:1:    expected unsigned int
drivers/crypto/caam/regs.h:95:1:    got restricted __le32 [usertype] <noident>
drivers/crypto/caam/regs.h:95:1: sparse: incorrect type in return expression (different base types) @@    expected unsigned int @@    got restricted __be32unsigned int @@
drivers/crypto/caam/regs.h:95:1:    expected unsigned int
drivers/crypto/caam/regs.h:95:1:    got restricted __be32 [usertype] <noident>

drivers/crypto/caam/regs.h:92:1: sparse: cast to restricted __le32
drivers/crypto/caam/regs.h:92:1: sparse: cast to restricted __be32

Fixes: 261ea058 ("crypto: caam - handle core endianness != caam endianness")
Reported-by: Nkbuild test robot <lkp@intel.com>
Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 653f6e54
......@@ -70,22 +70,22 @@
extern bool caam_little_end;
extern bool caam_imx;
#define caam_to_cpu(len) \
static inline u##len caam##len ## _to_cpu(u##len val) \
{ \
if (caam_little_end) \
return le##len ## _to_cpu(val); \
else \
return be##len ## _to_cpu(val); \
#define caam_to_cpu(len) \
static inline u##len caam##len ## _to_cpu(u##len val) \
{ \
if (caam_little_end) \
return le##len ## _to_cpu((__force __le##len)val); \
else \
return be##len ## _to_cpu((__force __be##len)val); \
}
#define cpu_to_caam(len) \
static inline u##len cpu_to_caam##len(u##len val) \
{ \
if (caam_little_end) \
return cpu_to_le##len(val); \
else \
return cpu_to_be##len(val); \
#define cpu_to_caam(len) \
static inline u##len cpu_to_caam##len(u##len val) \
{ \
if (caam_little_end) \
return (__force u##len)cpu_to_le##len(val); \
else \
return (__force u##len)cpu_to_be##len(val); \
}
caam_to_cpu(16)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册