Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvmem: u-boot-env: fix crc32 casting type

This fixes:
drivers/nvmem/u-boot-env.c:141:17: sparse: sparse: cast to restricted __le32

Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220916122100.170016-14-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rafał Miłecki and committed by
Greg Kroah-Hartman
3717ca3e 9e8f208a

+1 -1
+1 -1
drivers/nvmem/u-boot-env.c
··· 139 139 data_offset = offsetof(struct u_boot_env_image_redundant, data); 140 140 break; 141 141 } 142 - crc32 = le32_to_cpu(*(uint32_t *)(buf + crc32_offset)); 142 + crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset)); 143 143 crc32_data_len = priv->mtd->size - crc32_data_offset; 144 144 data_len = priv->mtd->size - data_offset; 145 145