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

Commit e29387eb authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe
Browse files

block: Add fallthrough markers to switch statements

This patch suppresses gcc 7 warnings about falling through in switch
statements when building with W=1. From the gcc documentation: The
-Wimplicit-fallthrough=3 warning is enabled by -Wextra. See also
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html

.

Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0e9350de
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -533,6 +533,7 @@ ssize_t badblocks_store(struct badblocks *bb, const char *page, size_t len,
	case 3:
	case 3:
		if (newline != '\n')
		if (newline != '\n')
			return -EINVAL;
			return -EINVAL;
		/* fall through */
	case 2:
	case 2:
		if (length <= 0)
		if (length <= 0)
			return -EINVAL;
			return -EINVAL;
+1 −0
Original line number Original line Diff line number Diff line
@@ -681,6 +681,7 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
		 */
		 */
		if (elv_attempt_insert_merge(q, rq))
		if (elv_attempt_insert_merge(q, rq))
			break;
			break;
		/* fall through */
	case ELEVATOR_INSERT_SORT:
	case ELEVATOR_INSERT_SORT:
		BUG_ON(blk_rq_is_passthrough(rq));
		BUG_ON(blk_rq_is_passthrough(rq));
		rq->rq_flags |= RQF_SORTED;
		rq->rq_flags |= RQF_SORTED;
+2 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,8 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
		case IOPRIO_CLASS_RT:
		case IOPRIO_CLASS_RT:
			if (!capable(CAP_SYS_ADMIN))
			if (!capable(CAP_SYS_ADMIN))
				return -EPERM;
				return -EPERM;
			/* fall through, rt has prio field too */
			/* fall through */
			/* rt has prio field too */
		case IOPRIO_CLASS_BE:
		case IOPRIO_CLASS_BE:
			if (data >= IOPRIO_BE_NR || data < 0)
			if (data >= IOPRIO_BE_NR || data < 0)
				return -EINVAL;
				return -EINVAL;