]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
pinctrl: nexell: Cannot test unsigned to be negative
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 7 Aug 2025 09:16:55 +0000 (10:16 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 19 Aug 2025 17:25:10 +0000 (11:25 -0600)
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.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/pinctrl/nexell/pinctrl-s5pxx18.c

index e7d0994f29e740cf90c6d42d2154b926ab1a8f74..a6ae5764fbc1c31e258622ef15ed08aeefeaf90f 100644 (file)
@@ -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;