From: Andrew Goodbody Date: Thu, 7 Aug 2025 16:35:19 +0000 (+0100) Subject: power: regulator: lp87565: Cannot test unsigned for being negative X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f90028ccdbfc74487c4b40bd6fe5d34c3309b7a;p=thirdparty%2Fu-boot.git power: regulator: lp87565: Cannot test unsigned for being negative In lp87565_buck_val hex is an unsigned variable being assigned the return value from a function that returns int. Change hex to be an int so that the following test for an error as a negative value will work as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Reviewed-by: Frieder Schrempf --- diff --git a/drivers/power/regulator/lp87565_regulator.c b/drivers/power/regulator/lp87565_regulator.c index 2212cb5c651..ea9c7685e9f 100644 --- a/drivers/power/regulator/lp87565_regulator.c +++ b/drivers/power/regulator/lp87565_regulator.c @@ -82,8 +82,8 @@ static int lp87565_buck_val2volt(int val) static int lp87565_buck_val(struct udevice *dev, int op, int *uV) { - unsigned int hex, adr; - int ret; + unsigned int adr; + int hex, ret; struct dm_regulator_uclass_plat *uc_pdata; uc_pdata = dev_get_uclass_plat(dev);