From: Christos Gkekas <chris.gekas@gmail.com>
To: Richard Purdie <rpurdie@rpsys.net>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Pavel Machek <pavel@ucw.cz>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Christos Gkekas <chris.gekas@gmail.com>
Subject: [PATCH] leds: tca6507: Remove unnecessary reg check
Date: Sun, 8 Oct 2017 19:55:05 +0100 [thread overview]
Message-ID: <1507488905-23169-1-git-send-email-chris.gekas@gmail.com> (raw)
Variable reg is unsigned so checking whether it is less than zero is not
necessary.
Signed-off-by: Christos Gkekas <chris.gekas@gmail.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 45222a7..c12c16f 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -715,7 +715,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", ®);
- if (ret != 0 || reg < 0 || reg >= NUM_LEDS)
+ if (ret != 0 || reg >= NUM_LEDS)
continue;
tca_leds[reg] = led;
--
2.7.4
next reply other threads:[~2017-10-08 18:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 18:55 Christos Gkekas [this message]
2017-10-09 6:59 ` [PATCH] leds: tca6507: Remove unnecessary reg check Pavel Machek
2017-10-09 18:43 ` 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=1507488905-23169-1-git-send-email-chris.gekas@gmail.com \
--to=chris.gekas@gmail.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--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;
as well as URLs for NNTP newsgroup(s).