From: Andrew Goodbody Date: Tue, 22 Jul 2025 13:40:24 +0000 (+0100) Subject: imx93: adc: local variable ret should not be unsigned X-Git-Tag: v2025.10-rc1~11^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=110a23e479d6a885ec9be322e8e63e102b194439;p=thirdparty%2Fu-boot.git imx93: adc: local variable ret should not be unsigned 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 --- 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) {