From: Dario Binacchi Date: Thu, 22 Apr 2021 20:28:56 +0000 (+0200) Subject: pinctrl: single: fix a never true comparison X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=230bc623a49a214bdf1a53971404ab762414ec71;p=u-boot.git 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 Reviewed-by: Pratyush Yadav --- diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 17f3818dd1..ebb7602dde 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;