From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Douglas Anderson <dianders@chromium.org>
Cc: Rajendra Nayak <rnayak@codeaurora.org>,
linux-arm-msm@vger.kernel.org, Stephen Boyd <swboyd@chromium.org>,
Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value
Date: Fri, 28 May 2021 09:25:47 +0100 [thread overview]
Message-ID: <269ec480-e4b8-30c8-db3d-f45095fa1d46@linaro.org> (raw)
In-Reply-To: <20210521140031.1.Ibaca694aedfaff823feefa06b29ae746c641dd1a@changeid>
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@chromium.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.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);
>
prev parent reply other threads:[~2021-05-28 8:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 21:00 [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Douglas Anderson
2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
2021-05-21 22:03 ` Stephen Boyd
2021-05-21 22:02 ` [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Stephen Boyd
2021-05-28 8:25 ` Srinivas Kandagatla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=269ec480-e4b8-30c8-db3d-f45095fa1d46@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=dianders@chromium.org \
--cc=joe@perches.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rnayak@codeaurora.org \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).