[PATCH] pinctrl: nexell: Cannot test unsigned to be negative
Andrew Goodbody
andrew.goodbody at linaro.org
Thu Aug 7 11:26:19 CEST 2025
On 07/08/2025 10:19, Michael Nazzareno Trimarchi wrote:
> Hi Andrew
>
> On Thu, Aug 7, 2025 at 11:17 AM Andrew Goodbody
> <andrew.goodbody at linaro.org <mailto:andrew.goodbody at linaro.org>> wrote:
>
> In s5pxx18_pinctrl_set_state testing count to be negative will always
> fail as count is unsigned despite receiving the return value of a
> function that returns an int. Change count and idx to be of type int to
> allow the test to work as expected and remove the need for any implicit
> casts. Also change pin to be u32 which is what all called functions
> expect.
>
> This issue was found by Smatch.
>
>
> Nice to have the link to the tool. Is it possible to have it on CI?
>
> Michael
Hi Michael,
I intend to look at what needs to be done to add it to CI once I have
gone through my current list of issues. So yes I very much hope to have
it running in CI.
Andrew
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org
> <mailto:andrew.goodbody at linaro.org>>
> ---
> drivers/pinctrl/nexell/pinctrl-s5pxx18.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/nexell/pinctrl-s5pxx18.c b/drivers/
> pinctrl/nexell/pinctrl-s5pxx18.c
> index e7d0994f29e..a6ae5764fbc 100644
> --- a/drivers/pinctrl/nexell/pinctrl-s5pxx18.c
> +++ b/drivers/pinctrl/nexell/pinctrl-s5pxx18.c
> @@ -130,7 +130,8 @@ static int is_pin_alive(const char *name)
> static int s5pxx18_pinctrl_set_state(struct udevice *dev,
> struct udevice *config)
> {
> - unsigned int count, idx, pin;
> + u32 pin;
> + int count, idx;
> unsigned int pinfunc, pinpud, pindrv;
> unsigned long reg;
> const char *name;
>
> ---
> base-commit: 3526f990b77fca1c933f1d8b24eb9385010a05bf
> change-id: 20250807-pinctrl_nexell-bc6669ff52e9
>
> Best regards,
> --
> Andrew Goodbody <andrew.goodbody at linaro.org
> <mailto:andrew.goodbody at linaro.org>>
>
>
>
> --
> Michael Nazzareno Trimarchi
> Co-Founder & Chief Executive Officer
> M. +39 347 913 2170
> michael at amarulasolutions.com <mailto:michael at amarulasolutions.com>
> __________________________________
>
> Amarula Solutions BV
> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> T. +31 (0)85 111 9172
> info at amarulasolutions.com <mailto:info at amarulasolutions.com>
> www.amarulasolutions.com <http://www.amarulasolutions.com>
More information about the U-Boot
mailing list