Input: mark expected switch fall-through
Subsystems (2)
PATCH 1/1 Input: mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/input/joystick/db9.c: In function ‘db9_saturn_read_packet’:drivers/input/joystick/db9.c:256:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (tmp == 0xff) {
^drivers/input/joystick/db9.c:263:2: note: here
default:
^~~~~~~
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
--- drivers/input/joystick/db9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/db9.c +1 -1
@@ -259,7 +259,7 @@ static unsigned char db9_saturn_read_packet(struct parport *port, unsigned chardb9_saturn_write_sub (port, type,3 , powered,0 );return data[0 ] =0xe3 ; } -/* else: fall through */ +/* fall through */ default :return data[0 ]; }
Signature · 1 line
2.20.1
Quoted 13 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/input/joystick/db9.c: In function ‘db9_saturn_read_packet’:drivers/input/joystick/db9.c:256:6: warning: this statement may fall through [-Wimplicit-fallthrough=]if (tmp == 0xff) { ^
drivers/input/joystick/db9.c:263:2: note: here
default:
^~~~~~~
Quoted 7 lines
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied, thank you.
Quoted 20 lines
--- drivers/input/joystick/db9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/joystick/db9.c +1
-1@@ -259,7 +259,7 @@ static unsigned char db9_saturn_read_packet(struct parport *port, unsigned chardb9_saturn_write_sub (port, type,3 , powered,0 );return data[0 ] =0xe3 ; } -/* else: fall through */ +/* fall through */ default :return data[0 ]; }Signature · 1 line
2.20.1
Signature · 1 line
Dmitry
Quoted 17 lines · Dmitry Torokhov
Quoted 16 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/input/joystick/db9.c: In function ‘db9_saturn_read_packet’:drivers/input/joystick/db9.c:256:6: warning: this statement may fall through [-Wimplicit-fallthrough=]if (tmp == 0xff) { ^
drivers/input/joystick/db9.c:263:2: note: here
default:
^~~~~~~Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
Quoted 7 lines
Quoted 4 lines
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>Applied, thank you.
Thanks, Dmitry.
--
Gustavo