Skip to contentSkip to conversation

Input: sidewinder - mark expected switch fall-throughs

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Nov 9, 2017 – Nov 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: sidewinder - mark expected switch fall-throughs

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

---
 drivers/input/joystick/sidewinder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/joystick/sidewinder.c +5 -5
index 4a95b22..5e602a6 100644
@@ -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)
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 8 lines · 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

Applied, thank you.

Quoted 43 lines
---
 drivers/input/joystick/sidewinder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/joystick/sidewinder.c +5 -5
index 4a95b22..5e602a6 100644
@@ -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)
Signature · 1 line
2.7.4
Signature · 1 line
Dmitry