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

tty: hvc_xen: 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/tty/hvc/hvc_xen.c: In function ‘xencons_backend_changed’:
drivers/tty/hvc/hvc_xen.c:493:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)
^
drivers/tty/hvc/hvc_xen.c:496:2: note: here
case XenbusStateClosing:
^~~~

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

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 <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo A. R. Silva and committed by
Greg Kroah-Hartman
d56f00fd 3e913eeb

+1 -1
+1 -1
drivers/tty/hvc/hvc_xen.c
··· 492 492 case XenbusStateClosed: 493 493 if (dev->state == XenbusStateClosed) 494 494 break; 495 - /* Missed the backend's CLOSING state -- fallthrough */ 495 + /* fall through - Missed the backend's CLOSING state. */ 496 496 case XenbusStateClosing: 497 497 xenbus_frontend_closed(dev); 498 498 break;