diff mbox

block: Add default switch case to blk_pm_allow_request() to kill warning

Message ID 1511815254-18166-1-git-send-email-geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show

Commit Message

Geert Uytterhoeven Nov. 27, 2017, 8:40 p.m. UTC
With gcc 4.9.0:

    block/blk-core.c: In function 'blk_pm_allow_request':
    block/blk-core.c:2607: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>
---
 block/blk-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Nov. 28, 2017, 12:44 p.m. UTC | #1
What an annoying compiler :)

But otherwise this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index b8881750a3acd705..579e683c95e26049 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2610,9 +2610,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)