aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch')
-rw-r--r--target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch b/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch
new file mode 100644
index 0000000000..55c3c5d6fe
--- /dev/null
+++ b/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch
@@ -0,0 +1,52 @@
+From 1f7b4d87874624f4beb25253900a25306a193b8b Mon Sep 17 00:00:00 2001
+From: Douglas Anderson <dianders@chromium.org>
+Date: Fri, 11 Jun 2021 09:33:47 +0100
+Subject: [PATCH] nvmem: core: constify nvmem_cell_read_variable_common()
+ return value
+
+The caller doesn't modify the memory pointed to by the pointer so it
+can be const.
+
+Suggested-by: Stephen Boyd <swboyd@chromium.org>
+Signed-off-by: Douglas Anderson <dianders@chromium.org>
+Reviewed-by: Stephen Boyd <swboyd@chromium.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20210611083348.20170-9-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -1614,9 +1614,9 @@ int nvmem_cell_read_u64(struct device *d
+ }
+ EXPORT_SYMBOL_GPL(nvmem_cell_read_u64);
+
+-static void *nvmem_cell_read_variable_common(struct device *dev,
+- const char *cell_id,
+- size_t max_len, size_t *len)
++static const void *nvmem_cell_read_variable_common(struct device *dev,
++ const char *cell_id,
++ size_t max_len, size_t *len)
+ {
+ struct nvmem_cell *cell;
+ int nbits;
+@@ -1660,7 +1660,7 @@ int nvmem_cell_read_variable_le_u32(stru
+ u32 *val)
+ {
+ size_t len;
+- u8 *buf;
++ const u8 *buf;
+ int i;
+
+ buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
+@@ -1691,7 +1691,7 @@ int nvmem_cell_read_variable_le_u64(stru
+ u64 *val)
+ {
+ size_t len;
+- u8 *buf;
++ const u8 *buf;
+ int i;
+
+ buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);