Re: [PATCH -next] pwm: lp3943: Fix an incorrect type in lp3943_pwm_parse_dt()

From: Uwe Kleine-König
Date: Sat Aug 10 2024 - 13:03:54 EST


Hello,

On Fri, Aug 09, 2024 at 10:50:49AM +0200, Uwe Kleine-König wrote:
> On 8/9/24 10:05, Jiapeng Chong wrote:
> > 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.
>
> Which tool does emit this warning? My test build (with C=1 and W=1) doesn't
> emit it.
>
> > Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9710
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>
>
> This problem was introduced in a commit in next:
>
> Fixes: d6a56f3bb650 ("pwm: lp3943: Use of_property_count_u32_elems() to get
> property length")
>
> Rob: I guess this wasn't the only conversion of this type. Maybe these
> others suffer from the same problem?!

I hoped for some more feedback, but anyhow: Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

with the Fixes line.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature