From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Axel Lin <axel.lin@ingics.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmem: core: Handle shift bits in-place if cell->nbits is non-zero
Date: Fri, 18 Sep 2015 10:58:01 +0100 [thread overview]
Message-ID: <55FBE029.1000507@linaro.org> (raw)
In-Reply-To: <1442569855.13652.1.camel@ingics.com>
Hi Axel,
Thanks for the patch
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
I remember fixing this sometime back which was reported by static
checker reported by Dan Carpenter, I forgot to send it over to wider
audience. Thanks for reminding.
--srini
On 18/09/15 10:50, Axel Lin wrote:
> It's pointless to test (cell->bit_offset || cell->bit_offset).
> nvmem_shift_read_buffer_in_place() should be called when
> (cell->bit_offset || cell->nbits).
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/nvmem/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index d3c6676..c39723a 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -825,7 +825,7 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
> return rc;
>
> /* shift bits in-place */
> - if (cell->bit_offset || cell->bit_offset)
> + if (cell->bit_offset || cell->nbits)
> nvmem_shift_read_buffer_in_place(cell, buf);
>
> *len = cell->bytes;
>
prev parent reply other threads:[~2015-09-18 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 9:50 [PATCH] nvmem: core: Handle shift bits in-place if cell->nbits is non-zero Axel Lin
2015-09-18 9:58 ` 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=55FBE029.1000507@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
/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