[PATCH] imx93: adc: local variable ret should not be unsigned

Andrew Goodbody andrew.goodbody at linaro.org
Tue Jul 22 15:40:24 CEST 2025


Local variable ret is declared as unsigned but is used to receive the
return value of functions that return int. ret is then tested for being
negative which must always fail. Change ret to be an int.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 drivers/adc/imx93-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/adc/imx93-adc.c b/drivers/adc/imx93-adc.c
index f593fb6447b..d671df79f68 100644
--- a/drivers/adc/imx93-adc.c
+++ b/drivers/adc/imx93-adc.c
@@ -221,7 +221,7 @@ static int imx93_adc_stop(struct udevice *dev)
 static int imx93_adc_probe(struct udevice *dev)
 {
 	struct imx93_adc_priv *adc = dev_get_priv(dev);
-	unsigned int ret;
+	int ret;
 
 	ret = imx93_adc_calibration(adc);
 	if (ret < 0)
@@ -238,7 +238,7 @@ static int imx93_adc_of_to_plat(struct udevice *dev)
 {
 	struct adc_uclass_plat *uc_pdata = dev_get_uclass_plat(dev);
 	struct imx93_adc_priv *adc = dev_get_priv(dev);
-	unsigned int ret;
+	int ret;
 
 	adc->regs = dev_read_addr_ptr(dev);
 	if (adc->regs == (struct imx93_adc *)FDT_ADDR_T_NONE) {

---
base-commit: bd0ade7d090a334b3986936d63a34001d99722ad
change-id: 20250722-imx93_adc-496f22f0c68d

Best regards,
-- 
Andrew Goodbody <andrew.goodbody at linaro.org>



More information about the U-Boot mailing list