From: Rafał Miłecki Date: Fri, 16 Sep 2022 12:21:00 +0000 (+0100) Subject: nvmem: u-boot-env: fix crc32 casting type X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3717ca3e0cc8683f93b41d3f06ca79631eb58715;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220916122100.170016-14-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c index d17a164ae7051..8e72d1bbd6490 100644 --- a/drivers/nvmem/u-boot-env.c +++ b/drivers/nvmem/u-boot-env.c @@ -139,7 +139,7 @@ static int u_boot_env_parse(struct u_boot_env *priv) data_offset = offsetof(struct u_boot_env_image_redundant, data); break; } - crc32 = le32_to_cpu(*(uint32_t *)(buf + crc32_offset)); + crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset)); crc32_data_len = priv->mtd->size - crc32_data_offset; data_len = priv->mtd->size - data_offset;