Commit 48b77cdc authored by Marek Behún's avatar Marek Behún Committed by Pavel Machek

leds: ns2: remove unneeded variable

No need to use variable found, we can determine whether the mode was
found by comparing iterator variable to its limit.
Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Vincent Donnefort <vdonnefort@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent a4a469b4
...@@ -71,16 +71,13 @@ static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode) ...@@ -71,16 +71,13 @@ static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode) static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode)
{ {
int i; int i;
bool found = false;
unsigned long flags; unsigned long flags;
for (i = 0; i < led->num_modes; i++) for (i = 0; i < led->num_modes; i++)
if (mode == led->modval[i].mode) { if (mode == led->modval[i].mode)
found = true;
break; break;
}
if (!found) if (i == led->num_modes)
return; return;
write_lock_irqsave(&led->rw_lock, flags); write_lock_irqsave(&led->rw_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment