summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2017-06-21 12:40:11 -0400
committerJens Axboe <axboe@kernel.dk>2017-06-21 13:46:07 -0400
commite29387ebd86e903702422a8361fd3e03aca25573 (patch)
treea47ec01680c8f05dd74e5fb37c3686811d286b3e
parent0e9350de2ecdf22f003107d3d21db59e17c521ad (diff)
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: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/badblocks.c1
-rw-r--r--block/elevator.c1
-rw-r--r--block/ioprio.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/block/badblocks.c b/block/badblocks.c
index 6ebcef282314..43c71166e1e2 100644
--- a/block/badblocks.c
+++ b/block/badblocks.c
@@ -533,6 +533,7 @@ ssize_t badblocks_store(struct badblocks *bb, const char *page, size_t len,
533 case 3: 533 case 3:
534 if (newline != '\n') 534 if (newline != '\n')
535 return -EINVAL; 535 return -EINVAL;
536 /* fall through */
536 case 2: 537 case 2:
537 if (length <= 0) 538 if (length <= 0)
538 return -EINVAL; 539 return -EINVAL;
diff --git a/block/elevator.c b/block/elevator.c
index dac99fbfc273..4bb2f0c93fa6 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -681,6 +681,7 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
681 */ 681 */
682 if (elv_attempt_insert_merge(q, rq)) 682 if (elv_attempt_insert_merge(q, rq))
683 break; 683 break;
684 /* fall through */
684 case ELEVATOR_INSERT_SORT: 685 case ELEVATOR_INSERT_SORT:
685 BUG_ON(blk_rq_is_passthrough(rq)); 686 BUG_ON(blk_rq_is_passthrough(rq));
686 rq->rq_flags |= RQF_SORTED; 687 rq->rq_flags |= RQF_SORTED;
diff --git a/block/ioprio.c b/block/ioprio.c
index 4b120c9cf7e8..6f5d0b6625e3 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -75,7 +75,8 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
75 case IOPRIO_CLASS_RT: 75 case IOPRIO_CLASS_RT:
76 if (!capable(CAP_SYS_ADMIN)) 76 if (!capable(CAP_SYS_ADMIN))
77 return -EPERM; 77 return -EPERM;
78 /* fall through, rt has prio field too */ 78 /* fall through */
79 /* rt has prio field too */
79 case IOPRIO_CLASS_BE: 80 case IOPRIO_CLASS_BE:
80 if (data >= IOPRIO_BE_NR || data < 0) 81 if (data >= IOPRIO_BE_NR || data < 0)
81 return -EINVAL; 82 return -EINVAL;