linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: sidewinder - mark expected switch fall-throughs
@ 2017-11-09  3:02 Gustavo A. R. Silva
  2017-11-10 18:24 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-11-09  3:02 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114763
Addresses-Coverity-ID: 114764
Addresses-Coverity-ID: 114765
Addresses-Coverity-ID: 114766
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/input/joystick/sidewinder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index 4a95b22..5e602a6 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -672,16 +672,16 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
 
 			switch (i * m) {
 				case 60:
-					sw->number++;
+					sw->number++;			/* fall through */
 				case 45:				/* Ambiguous packet length */
 					if (j <= 40) {			/* ID length less or eq 40 -> FSP */
 				case 43:
 						sw->type = SW_ID_FSP;
 						break;
 					}
-					sw->number++;
+					sw->number++;			/* fall through */
 				case 30:
-					sw->number++;
+					sw->number++;			/* fall through */
 				case 15:
 					sw->type = SW_ID_GP;
 					break;
@@ -697,9 +697,9 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
 						sw->type = SW_ID_PP;
 					break;
 				case 66:
-					sw->bits = 3;
+					sw->bits = 3;			/* fall through */
 				case 198:
-					sw->length = 22;
+					sw->length = 22;		/* fall through */
 				case 64:
 					sw->type = SW_ID_3DP;
 					if (j == 160)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: sidewinder - mark expected switch fall-throughs
  2017-11-09  3:02 [PATCH] Input: sidewinder - mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-11-10 18:24 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2017-11-10 18:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: linux-input, linux-kernel

On Wed, Nov 08, 2017 at 09:02:50PM -0600, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 114763
> Addresses-Coverity-ID: 114764
> Addresses-Coverity-ID: 114765
> Addresses-Coverity-ID: 114766
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Applied, thank you.

> ---
>  drivers/input/joystick/sidewinder.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
> index 4a95b22..5e602a6 100644
> --- a/drivers/input/joystick/sidewinder.c
> +++ b/drivers/input/joystick/sidewinder.c
> @@ -672,16 +672,16 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
>  
>  			switch (i * m) {
>  				case 60:
> -					sw->number++;
> +					sw->number++;			/* fall through */
>  				case 45:				/* Ambiguous packet length */
>  					if (j <= 40) {			/* ID length less or eq 40 -> FSP */
>  				case 43:
>  						sw->type = SW_ID_FSP;
>  						break;
>  					}
> -					sw->number++;
> +					sw->number++;			/* fall through */
>  				case 30:
> -					sw->number++;
> +					sw->number++;			/* fall through */
>  				case 15:
>  					sw->type = SW_ID_GP;
>  					break;
> @@ -697,9 +697,9 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
>  						sw->type = SW_ID_PP;
>  					break;
>  				case 66:
> -					sw->bits = 3;
> +					sw->bits = 3;			/* fall through */
>  				case 198:
> -					sw->length = 22;
> +					sw->length = 22;		/* fall through */
>  				case 64:
>  					sw->type = SW_ID_3DP;
>  					if (j == 160)
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-10 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09  3:02 [PATCH] Input: sidewinder - mark expected switch fall-throughs Gustavo A. R. Silva
2017-11-10 18:24 ` Dmitry Torokhov

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).