Skip to content

Commit 75de725

Browse files
Lee Jonesthierryreding
authored andcommitted
pwm: bcm-kona: Remove impossible comparison when validating duty cycle
'dc' here is an unsigned long, thus checking for <0 will always evaluate to false. Fixes the following W=1 warning: drivers/pwm/pwm-bcm-kona.c:141:35: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Cc: Florian Fainelli <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 9443f2c commit 75de725

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-bcm-kona.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int kona_pwmc_config(struct pwm_chip *chip, struct pwm_device *pwm,
138138
dc = div64_u64(val, div);
139139

140140
/* If duty_ns or period_ns are not achievable then return */
141-
if (pc < PERIOD_COUNT_MIN || dc < DUTY_CYCLE_HIGH_MIN)
141+
if (pc < PERIOD_COUNT_MIN)
142142
return -EINVAL;
143143

144144
/* If pc and dc are in bounds, the calculation is done */

0 commit comments

Comments
 (0)