All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Olof Johansson <olof@lxom.net>,
	Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	"David S . Miller" <davem@davemloft.net>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	Paul Lawrence <paullawrence@google.com>,
	Sandipan Das <sandipan@linux.vnet.ibm.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Will Deacon <will.deacon@arm.com>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Paul Burton <paul.burton@mips.com>,
	David Rientjes <rientjes@google.com>, Willy Tarreau <w@1wt.eu>,
	Martin Sebor <msebor@gmail.com>,
	Christopher Li <sparse@chrisli.org>,
	Jonathan Corbet <corbet@lwn.net>, "Theodore Ts'o" <tytso@mit.edu>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Joe Perches <joe@perches.com>, Arnd Bergmann <arnd@arndb.de>,
	Dominique Martinet <asmadeus@codewreck.org>,
	Stefan Agner <stefan@agner.ch>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	Sparse Mailing-list <linux-sparse@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough
Date: Mon, 22 Oct 2018 07:10:02 -0700	[thread overview]
Message-ID: <CAGXu5j+3pR2mfcdbURv7MrPxUVjmjQEDRHH8BLpTNGiasJs1pg@mail.gmail.com> (raw)
In-Reply-To: <20181021171414.22674-3-miguel.ojeda.sandonis@gmail.com>

On Sun, Oct 21, 2018 at 10:14 AM, Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> 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 <miguel.ojeda.sandonis@gmail.com>
> ---
>  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

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Olof Johansson <olof@lxom.net>,
	Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	"David S . Miller" <davem@davemloft.net>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	Paul Lawrence <paullawrence@google.com>,
	Sandipan Das <sandipan@linux.vnet.ibm.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough
Date: Mon, 22 Oct 2018 07:10:02 -0700	[thread overview]
Message-ID: <CAGXu5j+3pR2mfcdbURv7MrPxUVjmjQEDRHH8BLpTNGiasJs1pg@mail.gmail.com> (raw)
In-Reply-To: <20181021171414.22674-3-miguel.ojeda.sandonis@gmail.com>

On Sun, Oct 21, 2018 at 10:14 AM, Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> 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 <miguel.ojeda.sandonis@gmail.com>
> ---
>  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

  parent reply	other threads:[~2018-10-22 14:10 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-21 17:14 [PATCH 0/2] Compiler Attributes: __fallthrough Miguel Ojeda
2018-10-21 17:14 ` Miguel Ojeda
2018-10-21 17:14 ` [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) Miguel Ojeda
2018-10-21 17:14   ` Miguel Ojeda
2018-10-21 17:14   ` Miguel Ojeda
2018-10-21 22:27   ` Theodore Y. Ts'o
2018-10-21 22:27     ` Theodore Y. Ts'o
2018-10-22  9:26     ` Miguel Ojeda
2018-10-22  9:34       ` Kees Cook
2018-10-22  9:34         ` Kees Cook
2018-10-22  9:41         ` Miguel Ojeda
2018-10-22  9:41           ` Miguel Ojeda
2018-10-22  9:43           ` Miguel Ojeda
2018-10-22  9:43             ` Miguel Ojeda
2018-10-22 17:17             ` Nick Desaulniers
2018-10-22 17:17               ` Nick Desaulniers
2018-10-22 20:59               ` Miguel Ojeda
2018-10-22 20:59                 ` Miguel Ojeda
2018-10-22 10:53           ` Kees Cook
2018-10-22 10:53             ` Kees Cook
2018-10-22 11:24             ` Miguel Ojeda
2018-10-22 11:24               ` Miguel Ojeda
2018-10-22 13:39               ` Miguel Ojeda
2018-10-22 13:39                 ` Miguel Ojeda
2018-10-22 17:23       ` Nick Desaulniers
2018-10-22 17:23         ` Nick Desaulniers
2018-10-22  9:41     ` Bernd Petrovitsch
2018-10-22 10:27       ` Dan Carpenter
2018-10-22 10:27         ` Dan Carpenter
2018-10-22 10:45         ` Bernd Petrovitsch
2018-10-22 10:45           ` Bernd Petrovitsch
2018-10-22 10:53           ` Dan Carpenter
2018-10-22 10:53             ` Dan Carpenter
2018-10-22 11:07             ` Miguel Ojeda
2018-10-22 11:07               ` Miguel Ojeda
2018-10-22 17:49               ` Bernd Petrovitsch
2018-10-22 17:49                 ` Bernd Petrovitsch
2018-10-22 17:49                 ` Bernd Petrovitsch
2018-10-22 17:54                 ` Nick Desaulniers
2018-10-22 17:54                   ` Nick Desaulniers
2018-10-22 18:13                   ` Bernd Petrovitsch
2018-10-22 18:13                     ` Bernd Petrovitsch
2018-10-22 19:56                     ` Nick Desaulniers
2018-10-22 21:34                 ` Miguel Ojeda
2018-10-22 21:34                   ` Miguel Ojeda
2018-10-22 17:26             ` Nick Desaulniers
2018-10-22 17:26               ` Nick Desaulniers
2018-10-22  0:42   ` Matthew Wilcox
2018-10-22  0:42     ` Matthew Wilcox
2018-10-22  6:58     ` Theodore Y. Ts'o
2018-10-22  6:58       ` Theodore Y. Ts'o
2018-10-22  7:05       ` Willy Tarreau
2018-10-22  9:32     ` Miguel Ojeda
2018-10-22  9:32       ` Miguel Ojeda
2018-10-22 12:07   ` Luc Van Oostenryck
2018-10-22 12:07     ` Luc Van Oostenryck
2018-10-22 12:09     ` Miguel Ojeda
2018-10-22 12:09       ` Miguel Ojeda
2018-10-22 17:36   ` Nick Desaulniers
2018-10-22 17:36     ` Nick Desaulniers
2018-10-22 21:17     ` Miguel Ojeda
2018-10-22 21:17       ` Miguel Ojeda
2018-10-21 17:14 ` [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough Miguel Ojeda
2018-10-21 17:14   ` Miguel Ojeda
2018-10-21 18:11   ` Joe Perches
2018-10-21 18:11     ` Joe Perches
2018-10-22  9:51     ` Miguel Ojeda
2018-10-22  9:51       ` Miguel Ojeda
2018-10-22 15:48       ` Joe Perches
2018-10-22 15:48         ` Joe Perches
2018-10-22 14:10   ` Kees Cook [this message]
2018-10-22 14:10     ` Kees Cook
     [not found]     ` <20181023053542.lsklua2p3lnbkqir@mwanda>
2018-11-02 10:49       ` Miguel Ojeda
2018-11-02 10:49         ` Miguel Ojeda
2018-11-02 10:56         ` Miguel Ojeda
2018-11-02 10:56           ` Miguel Ojeda
2018-10-21 18:29 ` [PATCH 0/2] Compiler Attributes: __fallthrough Greg Kroah-Hartman
2018-10-21 18:29   ` Greg Kroah-Hartman
2018-10-21 18:52   ` Joe Perches
2018-10-21 18:52     ` Joe Perches
2018-10-22  5:27     ` Dan Carpenter
2018-10-22  5:27       ` Dan Carpenter
2018-10-22  9:48   ` Miguel Ojeda
2018-10-22  9:48     ` Miguel Ojeda
2018-10-22 16:54     ` Nick Desaulniers
2018-10-22 16:54       ` Nick Desaulniers
2018-10-22 21:23       ` Miguel Ojeda
2018-10-22 21:23         ` Miguel Ojeda
2018-10-23  5:43       ` Dan Carpenter
2018-10-23  5:43         ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGXu5j+3pR2mfcdbURv7MrPxUVjmjQEDRHH8BLpTNGiasJs1pg@mail.gmail.com \
    --to=keescook@chromium.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=asmadeus@codewreck.org \
    --cc=corbet@lwn.net \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=joe@perches.com \
    --cc=konstantin@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=mchehab+samsung@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@kernel.org \
    --cc=msebor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=olof@lxom.net \
    --cc=paul.burton@mips.com \
    --cc=paullawrence@google.com \
    --cc=pombredanne@nexb.com \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=sparse@chrisli.org \
    --cc=stefan@agner.ch \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=w@1wt.eu \
    --cc=will.deacon@arm.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.