Skip to contentSkip to conversation

regulator: fan53555: suppress warning about uninitialized variable

PATCH Applied Jules Maselbas 2 participants 2 messages Mar 14, 2025 – Mar 17, 2025 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: fan53555: suppress warning about uninitialized variable

In function 'fan53555_device_setup', a call to 'regmap_update_bits' is made with the mode_mask variable potentially uninitialized.

This can be the case if di->vendor is FAN53526_VENDOR_FAIRCHILD and di->sleep_vsel_id is not handled by the case (neither FAN53555_VSEL_ID_0 nor FAN53555_VSEL_ID_1). I am not sure how likely it is to happen.

---
 drivers/regulator/fan53555.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/fan53555.c +1 -1
index 2df0d2410a..2dcc6f5394 100644
@@ -238,7 +238,7 @@ static const struct regulator_ops fan53555_regulator_ops = {
 
 static int fan53555_device_setup(struct fan53555_device_info *di)
 {
-	unsigned int mode_reg, mode_mask;
+	unsigned int mode_reg, mode_mask = 0;
 	int ret = 0;
 
 	/* Setup voltage control register */
Signature · 1 line
2.48.1
Applied
#1 lore raw
Quoted 8 lines · Jules Maselbas

In function 'fan53555_device_setup', a call to 'regmap_update_bits' is made with the mode_mask variable potentially uninitialized.

This can be the case if di->vendor is FAN53526_VENDOR_FAIRCHILD and di->sleep_vsel_id is not handled by the case (neither FAN53555_VSEL_ID_0 nor FAN53555_VSEL_ID_1). I am not sure how likely it is to happen.

[...]

Applied, thanks!

[1/1] regulator: fan53555: suppress warning about uninitialized variable
https://git.pengutronix.de/cgit/barebox/commit/?id=55d10d7aa06f (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>