Skip to contentSkip to conversation

blk-mq: fix sparse warning on missed __percpu annotation

PATCH Applied Ming Lei 2 participants 2 messages Jun 3, 2014 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: fix sparse warning on missed __percpu annotation

'struct blk_mq_ctx' is __percpu, so add the annotation and fix the sparse warning reported from Fengguang:

	[block:for-linus 2/3] block/blk-mq.h:75:16: sparse: incorrect
	type in initializer (different address spaces)
---
 block/blk-mq.c         |    2 +-
 include/linux/blkdev.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
block/blk-mq.c +1 -1
index 43eb315..3bb4cfe 100644
@@ -1767,7 +1767,7 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
 struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set)
 {
 	struct blk_mq_hw_ctx **hctxs;
-	struct blk_mq_ctx *ctx;
+	struct blk_mq_ctx __percpu *ctx;
 	struct request_queue *q;
 	unsigned int *map;
 	int i;
include/linux/blkdev.h +1 -1
index 2f3886e..3cd426e 100644
@@ -335,7 +335,7 @@ struct request_queue {
 	unsigned int		*mq_map;
 
 	/* sw queues */
-	struct blk_mq_ctx	*queue_ctx;
+	struct blk_mq_ctx __percpu	*queue_ctx;
 	unsigned int		nr_queues;
 
 	/* hw dispatch queues */
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 5 lines · Ming Lei

'struct blk_mq_ctx' is __percpu, so add the annotation and fix the sparse warning reported from Fengguang:

	[block:for-linus 2/3] block/blk-mq.h:75:16: sparse: incorrect
	type in initializer (different address spaces)

Thanks, applied.

Signature · 1 line
Jens Axboe