* [PATCH v3] block: Add default switch case to blk_pm_allow_request() to kill warning
@ 2018-07-06 8:49 Geert Uytterhoeven
2018-07-06 15:09 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2018-07-06 8:49 UTC (permalink / raw)
To: Jens Axboe; +Cc: Arnd Bergmann, linux-block, linux-kernel, Geert Uytterhoeven
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>
---
v3:
- Update line number,
- Add gcc 7.3.0,
v2:
- Add Reviewed-by,
- Update line number.
---
block/blk-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index f84a9b7b6f5aa167..40e495073bdeec32 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2750,9 +2750,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)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] block: Add default switch case to blk_pm_allow_request() to kill warning
2018-07-06 8:49 [PATCH v3] block: Add default switch case to blk_pm_allow_request() to kill warning Geert Uytterhoeven
@ 2018-07-06 15:09 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-07-06 15:09 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Arnd Bergmann, linux-block, linux-kernel
On 7/6/18 2:49 AM, Geert Uytterhoeven wrote:
> 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.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-06 15:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 8:49 [PATCH v3] block: Add default switch case to blk_pm_allow_request() to kill warning Geert Uytterhoeven
2018-07-06 15:09 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).