* [PATCH RESEND][next] ceph: Fix fall-through warnings for Clang
@ 2021-03-05 9:59 Gustavo A. R. Silva
2021-03-05 14:07 ` Ilya Dryomov
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2021-03-05 9:59 UTC (permalink / raw)
To: Jeff Layton, Ilya Dryomov
Cc: ceph-devel, linux-kernel, Gustavo A. R. Silva, linux-hardening
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding a break and a goto statements instead
of just letting the code fall through to the next case.
Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
fs/ceph/dir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 83d9358854fb..3e575656713e 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -631,10 +631,12 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
switch (whence) {
case SEEK_CUR:
offset += file->f_pos;
+ break;
case SEEK_SET:
break;
case SEEK_END:
retval = -EOPNOTSUPP;
+ goto out;
default:
goto out;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND][next] ceph: Fix fall-through warnings for Clang
2021-03-05 9:59 [PATCH RESEND][next] ceph: Fix fall-through warnings for Clang Gustavo A. R. Silva
@ 2021-03-05 14:07 ` Ilya Dryomov
0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2021-03-05 14:07 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Jeff Layton, Ceph Development, LKML, linux-hardening
On Fri, Mar 5, 2021 at 10:59 AM Gustavo A. R. Silva
<gustavoars@kernel.org> wrote:
>
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
> of warnings by explicitly adding a break and a goto statements instead
> of just letting the code fall through to the next case.
>
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> fs/ceph/dir.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 83d9358854fb..3e575656713e 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -631,10 +631,12 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
> switch (whence) {
> case SEEK_CUR:
> offset += file->f_pos;
> + break;
> case SEEK_SET:
> break;
> case SEEK_END:
> retval = -EOPNOTSUPP;
> + goto out;
> default:
> goto out;
> }
> --
> 2.27.0
>
Applied.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-05 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 9:59 [PATCH RESEND][next] ceph: Fix fall-through warnings for Clang Gustavo A. R. Silva
2021-03-05 14:07 ` Ilya Dryomov
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).