Skip to contentSkip to conversation

power: supply: ab8500_charger: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Aug 5, 2019 – Sep 2, 2019

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

PATCH 1/1 power: supply: ab8500_charger: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: allmodconfig arm):

drivers/power/supply/ab8500_charger.c:738:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 drivers/power/supply/ab8500_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/ab8500_charger.c +1 -0
index 30de448de802..1be75a2fed9b 100644
@@ -742,6 +742,7 @@ static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
 						USB_CH_IP_CUR_LVL_1P5;
 			break;
 		}
+		/* else, fall through */
 	case USB_STAT_HM_IDGND:
 		dev_err(di->dev, "USB Type - Charging not allowed\n");
 		di->max_usb_in_curr.usb_type_max = USB_CH_IP_CUR_LVL_0P05;
Signature · 1 line
2.22.0
#1 lore raw

Hi,

Quoted 8 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: allmodconfig arm):

drivers/power/supply/ab8500_charger.c:738:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---

Thanks, queued.

-- Sebastian

Quoted 18 lines
 drivers/power/supply/ab8500_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/ab8500_charger.c +1 -0
index 30de448de802..1be75a2fed9b 100644
@@ -742,6 +742,7 @@ static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
 						USB_CH_IP_CUR_LVL_1P5;
 			break;
 		}
+		/* else, fall through */
 	case USB_STAT_HM_IDGND:
 		dev_err(di->dev, "USB Type - Charging not allowed\n");
 		di->max_usb_in_curr.usb_type_max = USB_CH_IP_CUR_LVL_0P05;
Signature · 1 line
2.22.0