drbd: Fix fall-through warnings for Clang
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 20 Apr 2021 20:25:51 +0000 (15:25 -0500)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Apr 2021 21:23:30 +0000 (15:23 -0600)
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding a break statement instead of just
letting the code fall through to the next, and by adding a fallthrough
pseudo-keyword in places whre the code is intended to fall through.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_req.c

index 7a32185347247958735145b5ce82b43426471502..69284ebba7861a9cad0387c8e2d07f621ce3c0b2 100644 (file)
@@ -5863,6 +5863,7 @@ static int got_NegRSDReply(struct drbd_connection *connection, struct packet_inf
                switch (pi->cmd) {
                case P_NEG_RS_DREPLY:
                        drbd_rs_failed_io(device, sector, size);
+                       break;
                case P_RS_CANCEL:
                        break;
                default:
index 9398c2c2cb2dffccf6f90473844ced3961d5b2e5..13beb98a7c5a307668d275fe98f42a0473524258 100644 (file)
@@ -753,6 +753,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
 
        case WRITE_ACKED_BY_PEER_AND_SIS:
                req->rq_state |= RQ_NET_SIS;
+               fallthrough;
        case WRITE_ACKED_BY_PEER:
                /* Normal operation protocol C: successfully written on peer.
                 * During resync, even in protocol != C,