1 From 1f7b4d87874624f4beb25253900a25306a193b8b Mon Sep 17 00:00:00 2001
2 From: Douglas Anderson <dianders@chromium.org>
3 Date: Fri, 11 Jun 2021 09:33:47 +0100
4 Subject: [PATCH] nvmem: core: constify nvmem_cell_read_variable_common()
7 The caller doesn't modify the memory pointed to by the pointer so it
10 Suggested-by: Stephen Boyd <swboyd@chromium.org>
11 Signed-off-by: Douglas Anderson <dianders@chromium.org>
12 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
13 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
14 Link: https://lore.kernel.org/r/20210611083348.20170-9-srinivas.kandagatla@linaro.org
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 drivers/nvmem/core.c | 10 +++++-----
18 1 file changed, 5 insertions(+), 5 deletions(-)
20 --- a/drivers/nvmem/core.c
21 +++ b/drivers/nvmem/core.c
22 @@ -1614,9 +1614,9 @@ int nvmem_cell_read_u64(struct device *d
24 EXPORT_SYMBOL_GPL(nvmem_cell_read_u64);
26 -static void *nvmem_cell_read_variable_common(struct device *dev,
27 - const char *cell_id,
28 - size_t max_len, size_t *len)
29 +static const void *nvmem_cell_read_variable_common(struct device *dev,
30 + const char *cell_id,
31 + size_t max_len, size_t *len)
33 struct nvmem_cell *cell;
35 @@ -1660,7 +1660,7 @@ int nvmem_cell_read_variable_le_u32(stru
43 buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
44 @@ -1691,7 +1691,7 @@ int nvmem_cell_read_variable_le_u64(stru
52 buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);