[PATCH][next] leds: TI LMU: remove redundant u8 comparisons with less than zero

From: Colin King
Date: Wed May 22 2019 - 04:29:46 EST


From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

The u8 variables ramp_up and ramp_down are being compared to less
than zero, this will always be false. Code is redundant so remove
it.

Addresses-Coverity: ("Unsigned compared against 0")
Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
drivers/leds/leds-ti-lmu-common.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/leds/leds-ti-lmu-common.c b/drivers/leds/leds-ti-lmu-common.c
index adc7293004f1..6db47accfe62 100644
--- a/drivers/leds/leds-ti-lmu-common.c
+++ b/drivers/leds/leds-ti-lmu-common.c
@@ -94,9 +94,6 @@ int ti_lmu_common_set_ramp(struct ti_lmu_bank *lmu_bank)
ramp_down = ti_lmu_common_convert_ramp_to_index(lmu_bank->ramp_down_usec);
}

- if (ramp_up < 0 || ramp_down < 0)
- return -EINVAL;
-
ramp = (ramp_up << 4) | ramp_down;

return regmap_write(regmap, lmu_bank->runtime_ramp_reg, ramp);
--
2.20.1