nvmem: u-boot-env: fix crc32 casting type
authorRafał Miłecki <rafal@milecki.pl>
Fri, 16 Sep 2022 12:21:00 +0000 (13:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2022 12:56:37 +0000 (14:56 +0200)
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>
drivers/nvmem/u-boot-env.c

index d17a164ae70514f529a56738b82473d67bfdd870..8e72d1bbd6490d003502ba94cf9a0124e4783956 100644 (file)
@@ -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;