power: supply: mark expected switch fall-throughs
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 17 Jul 2018 21:28:46 +0000 (16:28 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Sun, 22 Jul 2018 22:10:47 +0000 (00:10 +0200)
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1394724 ("Missing break in switch")
Addresses-Coverity-ID: 114958 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/axp20x_usb_power.c
drivers/power/supply/cros_usbpd-charger.c
drivers/power/supply/wm8350_power.c

index 44f70dcea61e3c7ac51086bb148ce894243ed933..42001df4bd13f147b1825e66791150ab4525dc98 100644 (file)
@@ -222,6 +222,7 @@ static int axp20x_usb_power_set_current_max(struct axp20x_usb_power *power,
        case 100000:
                if (power->axp20x_id == AXP221_ID)
                        return -EINVAL;
+               /* fall through */
        case 500000:
        case 900000:
                val = (900000 - intval) / 400000;
index 3a0c96fd1bc1fd539f22f7475a2ed6d0451bb44e..688a16bacfbbd509e053358cb6f59b5715f49864 100644 (file)
@@ -325,6 +325,7 @@ static int cros_usbpd_charger_get_prop(struct power_supply *psy,
                 */
                if (ec_device->mkbp_event_supported || port->psy_online)
                        break;
+               /* fall through */
        case POWER_SUPPLY_PROP_CURRENT_MAX:
        case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
        case POWER_SUPPLY_PROP_VOLTAGE_NOW:
index a2740cf57ad3e0de776e779c3ff179c68d5375d8..15c0ca15e2aa9d857625061682bfea47bb489fe4 100644 (file)
@@ -230,7 +230,8 @@ static irqreturn_t wm8350_charger_handler(int irq, void *data)
        case WM8350_IRQ_EXT_USB_FB:
        case WM8350_IRQ_EXT_WALL_FB:
                wm8350_charger_config(wm8350, policy);
-       case WM8350_IRQ_EXT_BAT_FB:   /* Fall through */
+               /* Fall through */
+       case WM8350_IRQ_EXT_BAT_FB:
                power_supply_changed(power->battery);
                power_supply_changed(power->usb);
                power_supply_changed(power->ac);