From: Douglas Anderson Date: Fri, 21 May 2021 21:00:57 +0000 (-0700) Subject: nvmem: core: constify nvmem_cell_read_variable_common() return value X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ee39cf8ba10605291f9c1a25c429554844a95822;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla --- diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f9c9c98599197..4868aa876e1b9 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1609,9 +1609,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; @@ -1655,7 +1655,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); @@ -1686,7 +1686,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);