Skip to contentSkip to conversation

ceph: Fix fall-through warnings for Clang

PATCH RESEND Applied Gustavo A. R. Silva 2 participants 2 messages Mar 5, 2021 Ceph client

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ceph: Fix fall-through warnings for Clang

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.

---
 fs/ceph/dir.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ceph/dir.c +2 -0
index 83d9358854fb..3e575656713e 100644
@@ -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;
 	}
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 29 lines · Gustavo A. R. Silva

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.

---
 fs/ceph/dir.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ceph/dir.c +2 -1
index 83d9358854fb..3e575656713e 100644
@@ -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;
        }
--
Quoted 2 lines

2.27.0

Applied.

Thanks,

Ilya