]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ceph: mark expected switch fall-throughs
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Sun, 15 Oct 2017 17:55:23 +0000 (12:55 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 13 Nov 2017 11:11:39 +0000 (12:11 +0100)
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
[idryomov@gmail.com: amended "Older OSDs" comment]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/ceph_hash.c
net/ceph/messenger.c
net/ceph/mon_client.c

index 67bb1f11e613ca4bcd4f635e096c00c9a61804a5..9a5850f264ed2fa1396fbb35db002e9e50309dbd 100644 (file)
@@ -47,28 +47,38 @@ unsigned int ceph_str_hash_rjenkins(const char *str, unsigned int length)
 
        /* handle the last 11 bytes */
        c = c + length;
-       switch (len) {            /* all the case statements fall through */
+       switch (len) {
        case 11:
                c = c + ((__u32)k[10] << 24);
+               /* fall through */
        case 10:
                c = c + ((__u32)k[9] << 16);
+               /* fall through */
        case 9:
                c = c + ((__u32)k[8] << 8);
                /* the first byte of c is reserved for the length */
+               /* fall through */
        case 8:
                b = b + ((__u32)k[7] << 24);
+               /* fall through */
        case 7:
                b = b + ((__u32)k[6] << 16);
+               /* fall through */
        case 6:
                b = b + ((__u32)k[5] << 8);
+               /* fall through */
        case 5:
                b = b + k[4];
+               /* fall through */
        case 4:
                a = a + ((__u32)k[3] << 24);
+               /* fall through */
        case 3:
                a = a + ((__u32)k[2] << 16);
+               /* fall through */
        case 2:
                a = a + ((__u32)k[1] << 8);
+               /* fall through */
        case 1:
                a = a + k[0];
                /* case 0: nothing left to add */
index ad93342c90d72cad59d4797608940b293f2a71fa..8a4d3758030b73d3b9ca24b09f91b1e65be0844e 100644 (file)
@@ -430,6 +430,7 @@ static void ceph_sock_state_change(struct sock *sk)
        switch (sk->sk_state) {
        case TCP_CLOSE:
                dout("%s TCP_CLOSE\n", __func__);
+               /* fall through */
        case TCP_CLOSE_WAIT:
                dout("%s TCP_CLOSE_WAIT\n", __func__);
                con_sock_state_closing(con);
index 9ae1bab8c05db7005d5c345dcb62f6e4b9e145fb..1547107f48544e9690319e4fe9415968448a9f87 100644 (file)
@@ -1279,9 +1279,10 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
 
                /*
                 * Older OSDs don't set reply tid even if the orignal
-                * request had a non-zero tid.  Workaround this weirdness
-                * by falling through to the allocate case.
+                * request had a non-zero tid.  Work around this weirdness
+                * by allocating a new message.
                 */
+               /* fall through */
        case CEPH_MSG_MON_MAP:
        case CEPH_MSG_MDS_MAP:
        case CEPH_MSG_OSD_MAP: