Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e16fb3a8 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva
Browse files

block: Mark expected switch fall-throughs



In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_int.h:1774:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3093:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_receiver.c:3120:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/block/drbd/drbd_req.c:856:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough

Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: default avatarRoland Kammerer <roland.kammerer@linbit.com>
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
parent afb33e40
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1778,7 +1778,7 @@ static inline void __drbd_chk_io_error_(struct drbd_device *device,
				_drbd_set_state(_NS(device, disk, D_INCONSISTENT), CS_HARD, NULL);
				_drbd_set_state(_NS(device, disk, D_INCONSISTENT), CS_HARD, NULL);
			break;
			break;
		}
		}
		/* NOTE fall through for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
		/* fall through - for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
	case EP_DETACH:
	case EP_DETACH:
	case EP_CALL_HELPER:
	case EP_CALL_HELPER:
		/* Remember whether we saw a READ or WRITE error.
		/* Remember whether we saw a READ or WRITE error.
+2 −2
Original line number Original line Diff line number Diff line
@@ -3094,7 +3094,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
			rv =  1;
			rv =  1;
			break;
			break;
		}
		}
		/* Else fall through to one of the other strategies... */
		/* Else fall through - to one of the other strategies... */
	case ASB_DISCARD_OLDER_PRI:
	case ASB_DISCARD_OLDER_PRI:
		if (self == 0 && peer == 1) {
		if (self == 0 && peer == 1) {
			rv = 1;
			rv = 1;
@@ -3119,7 +3119,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
		}
		}
		if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
		if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
			break;
			break;
		/* else: fall through */
		/* else, fall through */
	case ASB_DISCARD_LEAST_CHG:
	case ASB_DISCARD_LEAST_CHG:
		if	(ch_self < ch_peer)
		if	(ch_self < ch_peer)
			rv = -1;
			rv = -1;
+1 −1
Original line number Original line Diff line number Diff line
@@ -866,7 +866,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
			} /* else: FIXME can this happen? */
			} /* else: FIXME can this happen? */
			break;
			break;
		}
		}
		/* else, fall through to BARRIER_ACKED */
		/* else, fall through - to BARRIER_ACKED */


	case BARRIER_ACKED:
	case BARRIER_ACKED:
		/* barrier ack for READ requests does not make sense */
		/* barrier ack for READ requests does not make sense */
+1 −0
Original line number Original line Diff line number Diff line
@@ -439,6 +439,7 @@ static void card_state_change(struct rsxx_cardinfo *card,
		 * Fall through so the DMA devices can be attached and
		 * Fall through so the DMA devices can be attached and
		 * the user can attempt to pull off their data.
		 * the user can attempt to pull off their data.
		 */
		 */
		/* fall through */
	case CARD_STATE_GOOD:
	case CARD_STATE_GOOD:
		st = rsxx_get_card_size8(card, &card->size8);
		st = rsxx_get_card_size8(card, &card->size8);
		if (st)
		if (st)