From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: linux-kernel@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Richard Purdie <rpurdie@rpsys.net>,
linux-leds@vger.kernel.org
Subject: Re: [PATCH 30/38] leds: flash: remove invalid check
Date: Tue, 22 Sep 2015 09:36:43 +0200 [thread overview]
Message-ID: <5601050B.1000802@samsung.com> (raw)
In-Reply-To: <1442842450-29769-31-git-send-email-a.hajda@samsung.com>
Hi Andrzej,
On 09/21/2015 03:34 PM, Andrzej Hajda wrote:
> Unsigned cannot be lesser than zero.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> drivers/leds/led-class-flash.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
> index 3b25734..c209077 100644
> --- a/drivers/leds/led-class-flash.c
> +++ b/drivers/leds/led-class-flash.c
> @@ -108,7 +108,7 @@ static ssize_t flash_strobe_store(struct device *dev,
> if (ret)
> goto unlock;
>
> - if (state < 0 || state > 1) {
> + if (state > 1) {
> ret = -EINVAL;
> goto unlock;
> }
>
Merged, thanks.
--
Best Regards,
Jacek Anaszewski
next prev parent reply other threads:[~2015-09-22 7:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 13:33 [PATCH 00/38] Fixes related to incorrect usage of unsigned types Andrzej Hajda
2015-09-21 13:34 ` [PATCH 30/38] leds: flash: remove invalid check Andrzej Hajda
2015-09-22 7:36 ` Jacek Anaszewski [this message]
2015-09-21 13:34 ` [PATCH 31/38] leds: tca6507: " Andrzej Hajda
2015-09-22 7:37 ` Jacek Anaszewski
[not found] ` <1442842450-29769-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-09-21 13:42 ` [PATCH 00/38] Fixes related to incorrect usage of unsigned types David Howells
2015-09-22 9:13 ` Andrzej Hajda
2015-09-22 9:46 ` Jacek Anaszewski
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=5601050B.1000802@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=rpurdie@rpsys.net \
/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