[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5jJDjM6=wLLuj3rxwc9uVttG27Ux7UaszAkV=YTTWYDsyg@mail.gmail.com>
Date: Tue, 9 Apr 2019 09:30:30 -0700
From: Kees Cook <keescook@...omium.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Samuel Ortiz <sameo@...ux.intel.com>,
linux-wireless <linux-wireless@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] NFC: st21nfca: Fix a couple of fall-through warnings
On Tue, Feb 12, 2019 at 9:39 AM Gustavo A. R. Silva
<gustavo@...eddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warnings by adding a missing break
> and a fall-through annotation:
>
> drivers/nfc/st21nfca/dep.c: In function ‘st21nfca_tm_event_send_data’:
> drivers/nfc/st21nfca/dep.c:391:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> switch (cmd1) {
> ^~~~~~
> drivers/nfc/st21nfca/dep.c:404:2: note: here
> default:
> ^~~~~~~
> In file included from ./include/linux/kernel.h:15,
> from ./include/linux/skbuff.h:17,
> from ./include/net/nfc/hci.h:21,
> from drivers/nfc/st21nfca/dep.c:17:
> drivers/nfc/st21nfca/dep.c: In function ‘st21nfca_im_recv_dep_res_cb’:
> ./include/linux/printk.h:303:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
> printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/nfc/st21nfca/dep.c:622:4: note: in expansion of macro ‘pr_err’
> pr_err("Received a ACK/NACK PDU\n");
> ^~~~~~
> drivers/nfc/st21nfca/dep.c:623:3: note: here
> case ST21NFCA_NFC_DEP_PFB_I_PDU:
> ^~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
Reviewed-by: Kees Cook <keescook@...omium.org>
--
Kees Cook
Powered by blists - more mailing lists