aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorTom Rix <[email protected]>2020-08-09 09:32:21 -0700
committerPavel Machek <[email protected]>2020-08-17 18:04:11 +0200
commitfa31311c31634e5e900d61b1eb24df4c8555b5f8 (patch)
tree196daefe6767be1ea1f06aca672eb820ffe80b23 /tools/perf/scripts/python
parent2d26684a4af6d0829fa9ff637ff56160d571148f (diff)
leds: mt6323: move period calculation
clang static analysis reports this problem leds-mt6323.c:275:12: warning: Division by zero duty_hw = MT6323_CAL_HW_DUTY(*delay_on, period); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is because period can be 0. period = *delay_on + *delay_off; There is a later check that *delay_on/off are valid. if (!*delay_on && !*delay_off) { *delay_on = 500; *delay_off = 500; } Setting the delay_on/off means period needs to be recalculated anyway. So move the period statements after this check. Fixes: 216ec6cc4c19 ("leds: Add LED support for MT6323 PMIC") Signed-off-by: Tom Rix <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions