* [PATCH] power: supply: mark expected switch fall-throughs
@ 2018-07-17 21:28 Gustavo A. R. Silva
2018-07-22 22:11 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-17 21:28 UTC (permalink / raw)
To: Sebastian Reichel, Chen-Yu Tsai
Cc: linux-pm, linux-kernel, patches, Gustavo A. R. Silva
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>
---
drivers/power/supply/axp20x_usb_power.c | 1 +
drivers/power/supply/cros_usbpd-charger.c | 1 +
drivers/power/supply/wm8350_power.c | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 44f70dc..42001df 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -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;
diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
index 3a0c96f..688a16b 100644
--- a/drivers/power/supply/cros_usbpd-charger.c
+++ b/drivers/power/supply/cros_usbpd-charger.c
@@ -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:
diff --git a/drivers/power/supply/wm8350_power.c b/drivers/power/supply/wm8350_power.c
index a2740cf..15c0ca1 100644
--- a/drivers/power/supply/wm8350_power.c
+++ b/drivers/power/supply/wm8350_power.c
@@ -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);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: supply: mark expected switch fall-throughs
2018-07-17 21:28 [PATCH] power: supply: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-07-22 22:11 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2018-07-22 22:11 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Chen-Yu Tsai, linux-pm, linux-kernel, patches
[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]
Hi,
On Tue, Jul 17, 2018 at 04:28:46PM -0500, Gustavo A. R. Silva wrote:
> 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>
> ---
Thanks, queued into power-supply's for-next branch.
-- Sebastian
> drivers/power/supply/axp20x_usb_power.c | 1 +
> drivers/power/supply/cros_usbpd-charger.c | 1 +
> drivers/power/supply/wm8350_power.c | 3 ++-
> 3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
> index 44f70dc..42001df 100644
> --- a/drivers/power/supply/axp20x_usb_power.c
> +++ b/drivers/power/supply/axp20x_usb_power.c
> @@ -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;
> diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
> index 3a0c96f..688a16b 100644
> --- a/drivers/power/supply/cros_usbpd-charger.c
> +++ b/drivers/power/supply/cros_usbpd-charger.c
> @@ -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:
> diff --git a/drivers/power/supply/wm8350_power.c b/drivers/power/supply/wm8350_power.c
> index a2740cf..15c0ca1 100644
> --- a/drivers/power/supply/wm8350_power.c
> +++ b/drivers/power/supply/wm8350_power.c
> @@ -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);
> --
> 2.7.4
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-22 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 21:28 [PATCH] power: supply: mark expected switch fall-throughs Gustavo A. R. Silva
2018-07-22 22:11 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).