Skip to content

Commit a550d6a

Browse files
wb-zjp846396Uwe Kleine-König
authored andcommitted
pwm: lp3943: Fix an incorrect type in lp3943_pwm_parse_dt()
The return value from the call to of_property_count_u32_elems() is int. However, the return value is being assigned to an u32 variable 'num_outputs', so making 'num_outputs' an int. ./drivers/pwm/pwm-lp3943.c:238:6-17: WARNING: Unsigned expression compared with zero: num_outputs <= 0. Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9710 Signed-off-by: Jiapeng Chong <[email protected]> Fixes: 75f0cb3 ("pwm: lp3943: Use of_property_count_u32_elems() to get property length") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent d6a8007 commit a550d6a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/pwm/pwm-lp3943.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ static int lp3943_pwm_parse_dt(struct device *dev,
218218
struct lp3943_platform_data *pdata;
219219
struct lp3943_pwm_map *pwm_map;
220220
enum lp3943_pwm_output *output;
221-
int i, err, count = 0;
222-
u32 num_outputs;
221+
int i, err, num_outputs, count = 0;
223222

224223
if (!node)
225224
return -EINVAL;

0 commit comments

Comments
 (0)