aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDario Binacchi <dariobin@libero.it>2021-04-22 22:28:56 +0200
committerTom Rini <trini@konsulko.com>2021-04-27 08:05:30 -0400
commit230bc623a49a214bdf1a53971404ab762414ec71 (patch)
tree2e8e1dc2eeeab70a92c9f36bd84e2fc534e7fcc3 /drivers
parent69414d86ed57bf7b55ccd79d3d5ca5a01987a5b7 (diff)
downloadu-boot-230bc623a49a214bdf1a53971404ab762414ec71.zip
u-boot-230bc623a49a214bdf1a53971404ab762414ec71.tar.gz
u-boot-230bc623a49a214bdf1a53971404ab762414ec71.tar.bz2
pinctrl: single: fix a never true comparison
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 <dariobin@libero.it> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-single.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 17f3818..ebb7602 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -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;