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

Uwe Kleine-König
2024-08-10T17:03:45Z

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

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@linux.alibaba.com>
> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9710
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>
> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]