lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <269ec480-e4b8-30c8-db3d-f45095fa1d46@linaro.org>
Date:   Fri, 28 May 2021 09:25:47 +0100
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Douglas Anderson <dianders@...omium.org>
Cc:     Rajendra Nayak <rnayak@...eaurora.org>,
        linux-arm-msm@...r.kernel.org, Stephen Boyd <swboyd@...omium.org>,
        Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] nvmem: core: constify
 nvmem_cell_read_variable_common() return value



On 21/05/2021 22:00, Douglas Anderson wrote:
> The caller doesn't modify the memory pointed to by the pointer so it
> can be const.
> 
> Suggested-by: Stephen Boyd <swboyd@...omium.org>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
> 

Applied both thanks,

--srini
>   drivers/nvmem/core.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index f9c9c9859919..4868aa876e1b 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);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ