From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Douglas Miller <dougmill@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] net: ehea: Mark expected switch fall-through
Date: Mon, 29 Jul 2019 09:38:52 -0700 [thread overview]
Message-ID: <201907290938.3B407BE13C@keescook> (raw)
In-Reply-To: <20190729003009.GA25425@embeddedor>
On Sun, Jul 28, 2019 at 07:30:09PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':
> include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
> printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'
> pr_info("memory offlining canceled");
> ^~~~~~~
> drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
> case MEM_ONLINE:
> ^~~~
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
> index 4138a8480347..cca71ba7a74a 100644
> --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
> +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
> @@ -3251,7 +3251,7 @@ static int ehea_mem_notifier(struct notifier_block *nb,
> switch (action) {
> case MEM_CANCEL_OFFLINE:
> pr_info("memory offlining canceled");
> - /* Fall through: re-add canceled memory block */
> + /* Fall through - re-add canceled memory block */
>
> case MEM_ONLINE:
> pr_info("memory is going online");
> --
> 2.22.0
>
--
Kees Cook
next prev parent reply other threads:[~2019-07-29 16:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 0:30 [PATCH] net: ehea: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 16:38 ` Kees Cook [this message]
2019-07-29 18:12 ` David Miller
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=201907290938.3B407BE13C@keescook \
--to=keescook@chromium.org \
--cc=davem@davemloft.net \
--cc=dougmill@linux.ibm.com \
--cc=gustavo@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).