diff mbox series

[062/141] HID: usbhid: Fix fall-through warnings for Clang

Message ID 2ca011901b6a1313f71f3a3775078224c941a908.1605896059.git.gustavoars@kernel.org (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show
Series Fix fall-through warnings for Clang | expand

Commit Message

Gustavo A. R. Silva Nov. 20, 2020, 6:33 p.m. UTC
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding a couple of break statements instead
of letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/hid/usbhid/hid-core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jiri Kosina Nov. 25, 2020, 1:02 p.m. UTC | #1
On Fri, 20 Nov 2020, Gustavo A. R. Silva wrote:

> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
> of warnings by explicitly adding a couple of break statements instead
> of letting the code fall through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/hid/usbhid/hid-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 17a29ee0ac6c..86257ce6d619 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -438,6 +438,7 @@ static void hid_irq_out(struct urb *urb)
>  		break;
>  	case -ESHUTDOWN:	/* unplug */
>  		unplug = 1;
> +		break;
>  	case -EILSEQ:		/* protocol error or unplug */
>  	case -EPROTO:		/* protocol error or unplug */
>  	case -ECONNRESET:	/* unlink */
> @@ -489,6 +490,7 @@ static void hid_ctrl(struct urb *urb)
>  		break;
>  	case -ESHUTDOWN:	/* unplug */
>  		unplug = 1;
> +		break;
>  	case -EILSEQ:		/* protocol error or unplug */
>  	case -EPROTO:		/* protocol error or unplug */
>  	case -ECONNRESET:	/* unlink */

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 17a29ee0ac6c..86257ce6d619 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -438,6 +438,7 @@  static void hid_irq_out(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */
@@ -489,6 +490,7 @@  static void hid_ctrl(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */