Linux LED subsystem development
 help / color / mirror / Atom feed
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 31/38] leds: tca6507: remove invalid check
Date: Tue, 22 Sep 2015 09:37:16 +0200	[thread overview]
Message-ID: <5601052C.50809@samsung.com> (raw)
In-Reply-To: <1442842450-29769-32-git-send-email-a.hajda@samsung.com>

Hi Andrzej,

On 09/21/2015 03:34 PM, Andrzej Hajda wrote:
> unsigned value 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/leds-tca6507.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
> index edbecc4..93564f6 100644
> --- a/drivers/leds/leds-tca6507.c
> +++ b/drivers/leds/leds-tca6507.c
> @@ -713,7 +713,7 @@ tca6507_led_dt_init(struct i2c_client *client)
>   		if (of_property_match_string(child, "compatible", "gpio") >= 0)
>   			led.flags |= TCA6507_MAKE_GPIO;
>   		ret = of_property_read_u32(child, "reg", &reg);
> -		if (ret != 0 || reg < 0 || reg >= NUM_LEDS)
> +		if (ret != 0 || reg >= NUM_LEDS)
>   			continue;
>
>   		tca_leds[reg] = led;
>

Merged, thanks.

-- 
Best Regards,
Jacek Anaszewski

  reply	other threads:[~2015-09-22  7:37 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
2015-09-21 13:34 ` [PATCH 31/38] leds: tca6507: " Andrzej Hajda
2015-09-22  7:37   ` Jacek Anaszewski [this message]
     [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=5601052C.50809@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