Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

char: lp: 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 warnings:

drivers/char/lp.c: In function ‘lp_compat_ioctl’:
drivers/char/lp.c:756:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (!COMPAT_USE_64BIT_TIME) {
^
drivers/char/lp.c:761:2: note: here
case LPSETTIMEOUT_NEW:
^~~~
drivers/char/lp.c: In function ‘lp_ioctl’:
drivers/char/lp.c:728:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (BITS_PER_LONG == 32) {
^
drivers/char/lp.c:733:2: note: here
case LPSETTIMEOUT_NEW:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that in some cases, 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 <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo A. R. Silva and committed by
Greg Kroah-Hartman
ca5dc2d1 1aec4211

+2 -2
+2 -2
drivers/char/lp.c
··· 729 729 ret = lp_set_timeout32(minor, (void __user *)arg); 730 730 break; 731 731 } 732 - /* fallthrough for 64-bit */ 732 + /* fall through - for 64-bit */ 733 733 case LPSETTIMEOUT_NEW: 734 734 ret = lp_set_timeout64(minor, (void __user *)arg); 735 735 break; ··· 757 757 ret = lp_set_timeout32(minor, (void __user *)arg); 758 758 break; 759 759 } 760 - /* fallthrough for x32 mode */ 760 + /* fall through - for x32 mode */ 761 761 case LPSETTIMEOUT_NEW: 762 762 ret = lp_set_timeout64(minor, (void __user *)arg); 763 763 break;