diff options
author | Douglas Anderson <dianders@chromium.org> | 2021-06-11 11:33:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-11 11:57:56 +0300 |
commit | 1f7b4d87874624f4beb25253900a25306a193b8b (patch) | |
tree | f1d0e27c6712cbab7568c67fe26a2a01c7e7f399 /drivers/nvmem | |
parent | c813bb37bd32cb967060a2c573fae4ea518d32eb (diff) | |
download | linux-1f7b4d87874624f4beb25253900a25306a193b8b.tar.xz |
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>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r-- | drivers/nvmem/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index bca671ff4e54..b3c28a2d4c10 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1606,9 +1606,9 @@ int nvmem_cell_read_u64(struct device *dev, const char *cell_id, u64 *val) } 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; @@ -1652,7 +1652,7 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id, u32 *val) { size_t len; - u8 *buf; + const u8 *buf; int i; buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len); @@ -1683,7 +1683,7 @@ int nvmem_cell_read_variable_le_u64(struct device *dev, const char *cell_id, u64 *val) { size_t len; - u8 *buf; + const u8 *buf; int i; buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len); |