diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2019-05-31 09:39:51 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-06-06 09:38:57 +0300 |
commit | 49d22167f826134e579179aa2217c74647e62015 (patch) | |
tree | 9f440d6203d8872105c2f2669e1e9ee5d44d8aff /drivers/crypto/atmel-i2c.c | |
parent | 20a0f9761343fba9b25ea46bd3a3e5e533d974f8 (diff) | |
download | linux-49d22167f826134e579179aa2217c74647e62015.tar.xz |
crypto: atmel - Fix sparse endianness warnings
The param2 member in atmel_i2c_cmd is supposed to be little-endian
but was marked as u16. This patch changes it to a __le16 which
reveals a missing endian swap in atmel_i2c_init_read_cmd.
Another missing little-endian marking is also added in
atmel_i2c_checksum.
Fixes: 11105693fa05 ("crypto: atmel-ecc - introduce Microchip...")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-i2c.c')
-rw-r--r-- | drivers/crypto/atmel-i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.c index be49ab7f4338..dc876fab2882 100644 --- a/drivers/crypto/atmel-i2c.c +++ b/drivers/crypto/atmel-i2c.c @@ -34,7 +34,7 @@ static void atmel_i2c_checksum(struct atmel_i2c_cmd *cmd) { u8 *data = &cmd->count; size_t len = cmd->count - CRC_SIZE; - u16 *__crc16 = (u16 *)(data + len); + __le16 *__crc16 = (__le16 *)(data + len); *__crc16 = cpu_to_le16(bitrev16(crc16(0, data, len))); } @@ -48,7 +48,7 @@ void atmel_i2c_init_read_cmd(struct atmel_i2c_cmd *cmd) * (UserExtra, Selector, LockValue, LockConfig). */ cmd->param1 = CONFIG_ZONE; - cmd->param2 = DEVICE_LOCK_ADDR; + cmd->param2 = cpu_to_le16(DEVICE_LOCK_ADDR); cmd->count = READ_COUNT; atmel_i2c_checksum(cmd); |