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

xen, fbfront: 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/video/fbdev/xen-fbfront.c: In function ‘xenfb_backend_changed’:
drivers/video/fbdev/xen-fbfront.c:678:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)
^
drivers/video/fbdev/xen-fbfront.c:681: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>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Gustavo A. R. Silva and committed by
Bartlomiej Zolnierkiewicz
17de805a babc250e

+1 -1
+1 -1
drivers/video/fbdev/xen-fbfront.c
··· 677 677 case XenbusStateClosed: 678 678 if (dev->state == XenbusStateClosed) 679 679 break; 680 - /* Missed the backend's CLOSING state -- fallthrough */ 680 + /* fall through - Missed the backend's CLOSING state. */ 681 681 case XenbusStateClosing: 682 682 xenbus_frontend_closed(dev); 683 683 break;