diff options
| author | Andrew Goodbody <[email protected]> | 2025-08-07 17:35:23 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-08-29 16:45:19 -0600 |
| commit | c18435e648f7004dee1a80d06dbc06223d3b76b3 (patch) | |
| tree | d32c3dc319bcfb6d2670e1bb7716d46ef01ca0f8 /drivers | |
| parent | cdc0e32e9c56fc3d14007d4c93394e8bcc8daa08 (diff) | |
power: regulator: tps65941: Cannot test unsigned for being negative
In tps65941_buck_val and tps65941_ldo_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 <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/power/regulator/tps65941_regulator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c index 13f94b730d4..2561d6f4c6c 100644 --- a/drivers/power/regulator/tps65941_regulator.c +++ b/drivers/power/regulator/tps65941_regulator.c @@ -277,8 +277,8 @@ static const struct tps65941_reg_conv_ops buck_conv_ops[] = { static int tps65941_buck_val(struct udevice *dev, int op, int *uV) { - unsigned int hex, adr; - int ret, delta, uwait, slew, idx; + unsigned int adr; + int hex, ret, delta, uwait, slew, idx; struct dm_regulator_uclass_plat *uc_pdata; const struct tps65941_reg_conv_ops *conv_ops; ulong chip_id; @@ -479,8 +479,8 @@ static const struct tps65941_reg_conv_ops ldo_conv_ops[] = { static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) { - unsigned int hex, adr; - int ret, ret_volt, idx, ldo_bypass; + unsigned int adr; + int hex, ret, ret_volt, idx, ldo_bypass; struct dm_regulator_uclass_plat *uc_pdata; const struct tps65941_reg_conv_ops *conv_ops; ulong chip_id; |
