kernel: backport more NVMEM changes queued for v6.8
[openwrt/staging/jow.git] / target / linux / generic / pending-5.15 / 802-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
index 9b111050eeff012ba1396d6f020cea2aefb6b026..d07447bcba8eaabe4ba6d042c9f40b41a635c529 100644 (file)
@@ -36,9 +36,9 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
 
 --- a/drivers/nvmem/u-boot-env.c
 +++ b/drivers/nvmem/u-boot-env.c
-@@ -182,7 +182,7 @@ static int u_boot_env_parse(struct u_boo
-       crc32_data_len = priv->mtd->size - crc32_data_offset;
-       data_len = priv->mtd->size - data_offset;
+@@ -181,7 +181,7 @@ static int u_boot_env_parse(struct u_boo
+       crc32_data_len = dev_size - crc32_data_offset;
+       data_len = dev_size - data_offset;
  
 -      calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L;
 +      calc = le32_to_cpu((__le32)crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L);