diff mbox series

usb: host: ohci-tmio: Mark expected switch fall-throughs

Message ID 20190729222201.GA19408@embeddedor (mailing list archive)
State Mainlined
Commit 9e22cb82998253072ec05ee1f8b06daf5ca50800
Headers show
Series usb: host: ohci-tmio: Mark expected switch fall-throughs | expand

Commit Message

Gustavo A. R. Silva July 29, 2019, 10:22 p.m. UTC
Mark switch cases where we are expecting to fall through.

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

drivers/usb/host/ohci-tmio.c: In function ‘tmio_stop_hc’:
./include/linux/device.h:1499:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
  _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/ohci-tmio.c:99:4: note: in expansion of macro ‘dev_err’
    dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
    ^~~~~~~
In file included from drivers/usb/host/ohci-hcd.c:1257:0:
drivers/usb/host/ohci-tmio.c:100:3: note: here
   case 3:
   ^~~~
drivers/usb/host/ohci-tmio.c:101:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    pm |= CCR_PM_USBPW3;
       ^
drivers/usb/host/ohci-tmio.c:102:3: note: here
   case 2:
   ^~~~
drivers/usb/host/ohci-tmio.c:103:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    pm |= CCR_PM_USBPW2;
       ^
drivers/usb/host/ohci-tmio.c:104:3: note: here
   case 1:
   ^~~~

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/usb/host/ohci-tmio.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Alan Stern July 30, 2019, 1:51 p.m. UTC | #1
On Mon, 29 Jul 2019, Gustavo A. R. Silva wrote:

> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning (Building: arm):
> 
> drivers/usb/host/ohci-tmio.c: In function ‘tmio_stop_hc’:
> ./include/linux/device.h:1499:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/usb/host/ohci-tmio.c:99:4: note: in expansion of macro ‘dev_err’
>     dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
>     ^~~~~~~
> In file included from drivers/usb/host/ohci-hcd.c:1257:0:
> drivers/usb/host/ohci-tmio.c:100:3: note: here
>    case 3:
>    ^~~~
> drivers/usb/host/ohci-tmio.c:101:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     pm |= CCR_PM_USBPW3;
>        ^
> drivers/usb/host/ohci-tmio.c:102:3: note: here
>    case 2:
>    ^~~~
> drivers/usb/host/ohci-tmio.c:103:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     pm |= CCR_PM_USBPW2;
>        ^
> drivers/usb/host/ohci-tmio.c:104:3: note: here
>    case 1:
>    ^~~~
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ohci-tmio.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
> index d5a293a707b6..fb6f5e9ae5c6 100644
> --- a/drivers/usb/host/ohci-tmio.c
> +++ b/drivers/usb/host/ohci-tmio.c
> @@ -97,10 +97,13 @@ static void tmio_stop_hc(struct platform_device *dev)
>  	switch (ohci->num_ports) {
>  		default:
>  			dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
> +			/* fall through */
>  		case 3:
>  			pm |= CCR_PM_USBPW3;
> +			/* fall through */
>  		case 2:
>  			pm |= CCR_PM_USBPW2;
> +			/* fall through */
>  		case 1:
>  			pm |= CCR_PM_USBPW1;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
index d5a293a707b6..fb6f5e9ae5c6 100644
--- a/drivers/usb/host/ohci-tmio.c
+++ b/drivers/usb/host/ohci-tmio.c
@@ -97,10 +97,13 @@  static void tmio_stop_hc(struct platform_device *dev)
 	switch (ohci->num_ports) {
 		default:
 			dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
+			/* fall through */
 		case 3:
 			pm |= CCR_PM_USBPW3;
+			/* fall through */
 		case 2:
 			pm |= CCR_PM_USBPW2;
+			/* fall through */
 		case 1:
 			pm |= CCR_PM_USBPW1;
 	}