From: Jonathan Cameron <jic23@kernel.org>
To: Ico Doornekamp <ico@pruts.nl>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] io: adc: ad7606_core: fix signed/unsigned number comparison
Date: Sat, 1 Oct 2016 17:09:44 +0100 [thread overview]
Message-ID: <c4a0a801-14d6-7ea9-ec4f-958449a9dcb6@kernel.org> (raw)
In-Reply-To: <20160928134149.2563-1-ico@pruts.nl>
On 28/09/16 14:41, Ico Doornekamp wrote:
> reported by 'make W=2' in ad7606_oversampling_get_index()
>
> Signed-off-by: Ico Doornekamp <ico@pruts.nl>
hmm. It's pretty much a non problem in the first place as we know
it can't cause issues (can see it is 7). Also this really just
moves to typecasting it later when we return i.
So unless I'm missing something I'm not going to apply this one.
If Greg picks it up I don't mind though as doesn't do any harm
really.
Jonathan
> ---
> drivers/staging/iio/adc/ad7606_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
> index f79ee61..681389a 100644
> --- a/drivers/staging/iio/adc/ad7606_core.c
> +++ b/drivers/staging/iio/adc/ad7606_core.c
> @@ -158,7 +158,7 @@ static ssize_t ad7606_show_oversampling_ratio(struct device *dev,
> static int ad7606_oversampling_get_index(unsigned int val)
> {
> unsigned char supported[] = {0, 2, 4, 8, 16, 32, 64};
> - int i;
> + unsigned int i;
>
> for (i = 0; i < ARRAY_SIZE(supported); i++)
> if (val == supported[i])
>
next prev parent reply other threads:[~2016-10-01 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 13:41 [PATCH] io: adc: ad7606_core: fix signed/unsigned number comparison Ico Doornekamp
2016-10-01 16:09 ` Jonathan Cameron [this message]
2016-10-01 16:17 ` Ico Doornekamp
2016-10-01 16:49 ` Alison Schofield
2016-10-01 17:27 ` Ico Doornekamp
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=c4a0a801-14d6-7ea9-ec4f-958449a9dcb6@kernel.org \
--to=jic23@kernel.org \
--cc=ico@pruts.nl \
--cc=linux-iio@vger.kernel.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).