From: Christos Gkekas Date: Sun, 8 Oct 2017 18:55:05 +0000 (+0100) Subject: leds: tca6507: Remove unnecessary reg check X-Git-Tag: v4.15-rc1~116^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94bf9e0cbb15c0d8db6c869f09f901b07f01c386;p=thirdparty%2Fkernel%2Flinux.git leds: tca6507: Remove unnecessary reg check Variable reg is unsigned so checking whether it is less than zero is not necessary. Signed-off-by: Christos Gkekas Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski --- diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c index 45222a7f4f756..c12c16fb1b9ce 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;