Skip to contentSkip to conversation

power: supply: max77693_charger: fix unintentional fall-through

PATCH In review Gustavo A. R. Silva 3 participants 5 messages Jul 17, 2018 – Aug 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: max77693_charger: fix unintentional fall-through

It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense.

Addresses-Coverity-ID: 1271172 ("Missing break in switch")

Fixes 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/max77693_charger.c +1 -0
index 6c78884..749c792 100644
@@ -567,6 +567,7 @@ static int max77693_set_charge_input_threshold_volt(struct max77693_charger *chg
 	case 4800000:
 	case 4900000:
 		data = (uvolt - 4700000) / 100000;
+		break;
 	default:
 		dev_err(chg->dev, "Wrong value for charge input voltage regulation threshold\n");
 		return -EINVAL;
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense.

Addresses-Coverity-ID: 1271172 ("Missing break in switch")

Fixes 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)

Best regards,
Krzysztof

#2 lore raw

Hi Krzysztof,

Quoted 4 lines · Krzysztof Kozlowski
Quoted 3 lines · Gustavo A. R. Silva

It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense.

Quoted 9 lines
Quoted 6 lines

Addresses-Coverity-ID: 1271172 ("Missing break in switch")

Fixes 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)

BTW, I think this also should be tagged for stable.

Thanks
--
Gustavo

#3 lore raw
In reply to Krzysztof Kozlowski

Hi,

Quoted 4 lines · Krzysztof Kozlowski
Quoted 3 lines · Gustavo A. R. Silva

It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense.

Quoted 8 lines
Quoted 6 lines

Addresses-Coverity-ID: 1271172 ("Missing break in switch")

Fixes 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)

Thanks, queued to power-supply's fixes branch.

-- Sebastian

#4 lore raw

Hi Sebastian,

Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Gustavo A. R. Silva

It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense.

Addresses-Coverity-ID: 1271172 ("Missing break in switch")

Fixes 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 4 lines
Quoted 1 line

Thanks, queued to power-supply's fixes branch.

I think this should be tagged for stable.

Thanks
--
Gustavo