Skip to contentSkip to conversation

block: use enum type for blk_mq_alloc_data->rq_flags

PATCH In review Jens Axboe 3 participants 3 messages Nov 9, 2021 – Nov 10, 2021 Block layer

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 block: use enum type for blk_mq_alloc_data->rq_flags

kernel test robot reports that we now trigger some sparse warnings:

block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer

which is due to ->rq_flags being an unsigned int, rather than the stronger type req_flags_t enum.

Change the type to req_flags_t to silence this warning.

Fixes 56f8da642bd8 ("block: add rq_flags to struct blk_mq_alloc_data")

---

block/blk-mq.h +1 -1
index cb0b5482ca5e..39370bbdf3b6 100644
@@ -149,7 +149,7 @@ struct blk_mq_alloc_data {
 	blk_mq_req_flags_t flags;
 	unsigned int shallow_depth;
 	unsigned int cmd_flags;
-	unsigned int rq_flags;
+	req_flags_t rq_flags;
 
 	/* allocate multiple requests/tags in one go */
 	unsigned int nr_tags;
Signature · 1 line
Jens Axboe
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jens Axboe

kernel test robot reports that we now trigger some sparse warnings:

block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer

which is due to ->rq_flags being an unsigned int, rather than the stronger type req_flags_t enum.

Change the type to req_flags_t to silence this warning.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jens Axboe
Quoted 9 lines · Jens Axboe

External email: Use caution opening links or attachments

kernel test robot reports that we now trigger some sparse warnings:

block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer block/blk-mq.h:169:32: sparse: sparse: restricted req_flags_t degrades to integer

Quoted 9 lines

which is due to ->rq_flags being an unsigned int, rather than the stronger type req_flags_t enum.

Change the type to req_flags_t to silence this warning.

Fixes 56f8da642bd8 ("block: add rq_flags to struct blk_mq_alloc_data")