Return-Path: Received: from mail-yb1-f193.google.com ([209.85.219.193]:46926 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727210AbeJVW2z (ORCPT ); Mon, 22 Oct 2018 18:28:55 -0400 Received: by mail-yb1-f193.google.com with SMTP id o8-v6so16199609ybk.13 for ; Mon, 22 Oct 2018 07:10:10 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id o3-v6sm172018ywe.79.2018.10.22.07.10.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 07:10:08 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id o204-v6so2182242yba.9 for ; Mon, 22 Oct 2018 07:10:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20181021171414.22674-3-miguel.ojeda.sandonis@gmail.com> References: <20181021171414.22674-1-miguel.ojeda.sandonis@gmail.com> <20181021171414.22674-3-miguel.ojeda.sandonis@gmail.com> From: Kees Cook Date: Mon, 22 Oct 2018 07:10:02 -0700 Message-ID: Subject: Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough To: Miguel Ojeda , "Gustavo A. R. Silva" Cc: Greg Kroah-Hartman , LKML , Dan Carpenter , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , "David S . Miller" , Andrey Ryabinin , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Sandipan Das , Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , Paul Burton , David Rientjes , Willy Tarreau , Martin Sebor , Christopher Li , Jonathan Corbet , "Theodore Ts'o" , Geert Uytterhoeven , Rasmus Villemoes , Joe Perches , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , "open list:DOCUMENTATION" , Ext4 Developers List , Sparse Mailing-list , linux-kbuild Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org List-ID: On Sun, Oct 21, 2018 at 10:14 AM, Miguel Ojeda wrote: > Let gcc know these cases are meant to fall through to the next label > by annotating them with the new __fallthrough statement attribute; > and remove the comment since it conveys the same information > (which was also parsed by gcc to suppress the warning). > > Signed-off-by: Miguel Ojeda > --- > drivers/auxdisplay/panel.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c > index 21b9b2f2470a..0755034e49ba 100644 > --- a/drivers/auxdisplay/panel.c > +++ b/drivers/auxdisplay/panel.c > @@ -1367,7 +1367,7 @@ static void panel_process_inputs(void) > break; > input->rise_timer = 0; > input->state = INPUT_ST_RISING; > - /* fall through */ > + __fallthrough; > case INPUT_ST_RISING: > if ((phys_curr & input->mask) != input->value) { > input->state = INPUT_ST_LOW; > @@ -1380,11 +1380,11 @@ static void panel_process_inputs(void) > } > input->high_timer = 0; > input->state = INPUT_ST_HIGH; > - /* fall through */ > + __fallthrough; > case INPUT_ST_HIGH: > if (input_state_high(input)) > break; > - /* fall through */ > + __fallthrough; > case INPUT_ST_FALLING: > input_state_falling(input); > } > -- > 2.17.1 > I would prefer we continue to use the comment style until we've got confirmed support for (at least) Clang, Coverity, CPPcheck, smatch, and eclipse. -Kees -- Kees Cook Pixel Security