* [j.anaszewski-leds:for-next 3/14] drivers/leds/leds-ti-lmu-common.c:97 ti_lmu_common_set_ramp() warn: impossible condition '(ramp_up < 0) => (0-255 < 0)'
@ 2019-05-22 6:47 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-05-22 6:47 UTC (permalink / raw)
To: kbuild, Dan Murphy; +Cc: kbuild-all, linux-leds, Jacek Anaszewski
tree: https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git for-next
head: 413874ce52afa3310433e6dd73d775fd05bf92e7
commit: 9a8e66ebeaa20a4f3eba12f0eba6835e8db16ded [3/14] leds: TI LMU: Add common code for TI LMU devices
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/leds/leds-ti-lmu-common.c:97 ti_lmu_common_set_ramp() warn: impossible condition '(ramp_up < 0) => (0-255 < 0)'
drivers/leds/leds-ti-lmu-common.c:97 ti_lmu_common_set_ramp() warn: impossible condition '(ramp_down < 0) => (0-255 < 0)'
# https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?id=9a8e66ebeaa20a4f3eba12f0eba6835e8db16ded
git remote add j.anaszewski-leds https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
git remote update j.anaszewski-leds
git checkout 9a8e66ebeaa20a4f3eba12f0eba6835e8db16ded
vim +97 drivers/leds/leds-ti-lmu-common.c
9a8e66eb Dan Murphy 2019-05-06 83
9a8e66eb Dan Murphy 2019-05-06 84 int ti_lmu_common_set_ramp(struct ti_lmu_bank *lmu_bank)
9a8e66eb Dan Murphy 2019-05-06 85 {
9a8e66eb Dan Murphy 2019-05-06 86 struct regmap *regmap = lmu_bank->regmap;
9a8e66eb Dan Murphy 2019-05-06 87 u8 ramp, ramp_up, ramp_down;
9a8e66eb Dan Murphy 2019-05-06 88
9a8e66eb Dan Murphy 2019-05-06 89 if (lmu_bank->ramp_up_usec == 0 && lmu_bank->ramp_down_usec == 0) {
9a8e66eb Dan Murphy 2019-05-06 90 ramp_up = 0;
9a8e66eb Dan Murphy 2019-05-06 91 ramp_down = 0;
9a8e66eb Dan Murphy 2019-05-06 92 } else {
9a8e66eb Dan Murphy 2019-05-06 93 ramp_up = ti_lmu_common_convert_ramp_to_index(lmu_bank->ramp_up_usec);
9a8e66eb Dan Murphy 2019-05-06 94 ramp_down = ti_lmu_common_convert_ramp_to_index(lmu_bank->ramp_down_usec);
9a8e66eb Dan Murphy 2019-05-06 95 }
9a8e66eb Dan Murphy 2019-05-06 96
9a8e66eb Dan Murphy 2019-05-06 @97 if (ramp_up < 0 || ramp_down < 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Utterly unpossible!
9a8e66eb Dan Murphy 2019-05-06 98 return -EINVAL;
9a8e66eb Dan Murphy 2019-05-06 99
9a8e66eb Dan Murphy 2019-05-06 100 ramp = (ramp_up << 4) | ramp_down;
9a8e66eb Dan Murphy 2019-05-06 101
9a8e66eb Dan Murphy 2019-05-06 102 return regmap_write(regmap, lmu_bank->runtime_ramp_reg, ramp);
9a8e66eb Dan Murphy 2019-05-06 103
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-22 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 6:47 [j.anaszewski-leds:for-next 3/14] drivers/leds/leds-ti-lmu-common.c:97 ti_lmu_common_set_ramp() warn: impossible condition '(ramp_up < 0) => (0-255 < 0)' Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.