pinctrl: single: fix a never true comparison
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
drivers/pinctrl/pinctrl-single.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-single.c +2 -2
@@ -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 ;
@@ -344,7 +344,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 ;
Signature · 1 line
2.17.1
PATCH 1/1 pinctrl: single: fix a never true comparison
Quoted 2 lines · Dario Binacchi
As reported by Coverity Scan for Das U-Boot, the 'less-than-zero comparison of an unsigned value is never true.
Unbalanced quote.
Quoted 2 lines
Signed-off-by Dario Binacchi <[email protected]>
Reviewed-by Pratyush Yadav <[email protected]>
Signature · 3 lines
Regards, Pratyush Yadav Texas Instruments Inc.