From: Finn Thain <fthain@linux-m68k.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Kai Mäkisara" <Kai.Makisara@kolumbus.fi>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH] scsi: st: Add missing break in switch statement in st_ioctl()
Date: Wed, 18 Aug 2021 10:54:06 +1000 (AEST) [thread overview]
Message-ID: <7843ce6b-92ae-7b6c-1fc-acb0ffe2bbc0@linux-m68k.org> (raw)
In-Reply-To: <20210817235531.172995-1-nathan@kernel.org>
On Tue, 17 Aug 2021, Nathan Chancellor wrote:
> Clang + -Wimplicit-fallthrough warns:
>
> drivers/scsi/st.c:3831:2: warning: unannotated fall-through between
> switch labels [-Wimplicit-fallthrough]
> default:
> ^
> drivers/scsi/st.c:3831:2: note: insert 'break;' to avoid fall-through
> default:
> ^
> break;
> 1 warning generated.
>
> Clang's -Wimplicit-fallthrough is a little bit more pedantic than GCC's,
> requiring every case block to end in break, return, or fallthrough,
> rather than allowing implicit fallthroughs to cases that just contain
> break or return. Add a break so that there is no more warning, as has
> been done all over the tree already.
>
> Fixes: 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/scsi/st.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index 2d1b0594af69..0e36a36ed24d 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
> @@ -3828,6 +3828,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
> case CDROM_SEND_PACKET:
> if (!capable(CAP_SYS_RAWIO))
> return -EPERM;
> + break;
> default:
> break;
> }
>
> base-commit: 58dd8f6e1cf8c47e81fbec9f47099772ab75278b
>
Well, that sure is ugly.
Do you think the following change would cause any static checkers to spit
their dummys and throw their toys out of the pram?
@@ -3828,6 +3828,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
case CDROM_SEND_PACKET:
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
+ break;
- default:
- break;
}
next prev parent reply other threads:[~2021-08-18 0:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 23:55 Nathan Chancellor
2021-08-18 0:06 ` Gustavo A. R. Silva
2021-08-18 0:54 ` Finn Thain [this message]
2021-08-18 1:12 ` Nathan Chancellor
2021-09-14 3:43 ` Martin K. Petersen
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=7843ce6b-92ae-7b6c-1fc-acb0ffe2bbc0@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=Kai.Makisara@kolumbus.fi \
--cc=clang-built-linux@googlegroups.com \
--cc=gustavoars@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®