]> Git Repo - J-u-boot.git/commitdiff
pinctrl: single: fix a never true comparison
authorDario Binacchi <[email protected]>
Thu, 22 Apr 2021 20:28:56 +0000 (22:28 +0200)
committerStefan Roese <[email protected]>
Wed, 28 Apr 2021 08:05:13 +0000 (10:05 +0200)
As reported by Coverity Scan for Das U-Boot, the 'less-than-zero'
comparison of an unsigned value is never true.

Signed-off-by: Dario Binacchi <[email protected]>
Reviewed-by: Pratyush Yadav <[email protected]>
drivers/pinctrl/pinctrl-single.c

index 17f3818dd11eb9c011f2fca2fc3df2f702a2eef5..ebb7602dde80b13300838f7a2c4a33715507a2b9 100644 (file)
@@ -295,7 +295,7 @@ static int single_configure_pins(struct udevice *dev,
        func->npins = 0;
        for (n = 0; n < count; n++, pins++) {
                offset = fdt32_to_cpu(pins->reg);
-               if (offset < 0 || offset > pdata->offset) {
+               if (offset > pdata->offset) {
                        dev_err(dev, "  invalid register offset 0x%x\n",
                                offset);
                        continue;
@@ -348,7 +348,7 @@ static int single_configure_bits(struct udevice *dev,
        func->npins = 0;
        for (n = 0; n < count; n++, pins++) {
                offset = fdt32_to_cpu(pins->reg);
-               if (offset < 0 || offset > pdata->offset) {
+               if (offset > pdata->offset) {
                        dev_dbg(dev, "  invalid register offset 0x%x\n",
                                offset);
                        continue;
This page took 0.036016 seconds and 4 git commands to generate.