block: Add default switch case to blk_pm_allow_request() to kill warning
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 6 Jul 2018 08:49:35 +0000 (10:49 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Jul 2018 15:07:54 +0000 (09:07 -0600)
With gcc 4.9.0 and 7.3.0:

    block/blk-core.c: In function 'blk_pm_allow_request':
    block/blk-core.c:2747:2: warning: enumeration value 'RPM_ACTIVE' not handled in switch [-Wswitch]
      switch (rq->q->rpm_status) {
      ^

Convert the return statement below the switch() block into a default
case to fix this.

Fixes: e4f36b249b4d4e75 ("block: fix peeking requests during PM")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c

index 687d773..c4b57d8 100644 (file)
@@ -2753,9 +2753,9 @@ static bool blk_pm_allow_request(struct request *rq)
                return rq->rq_flags & RQF_PM;
        case RPM_SUSPENDED:
                return false;
+       default:
+               return true;
        }
-
-       return true;
 }
 #else
 static bool blk_pm_allow_request(struct request *rq)