Re: [PATCH] blk-mq: remove unnecessary check in blk_mq_alloc_tag_set

From: Jens Axboe
Date: Mon Apr 06 2015 - 11:54:38 EST


On 04/05/2015 10:44 PM, nimisolo wrote:
already check set->nr_hw_queues above :
if (!set->nr_hw_queues)
return -EINVAL;

Signed-off-by: nimisolo <nimisolo@xxxxxxxxxx>
---
block/blk-mq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index b7b8933..3ae21c4 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2161,7 +2161,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
if (set->queue_depth < set->reserved_tags + BLK_MQ_TAG_MIN)
return -EINVAL;

- if (!set->nr_hw_queues || !set->ops->queue_rq || !set->ops->map_queue)
+ if (!set->ops->queue_rq || !set->ops->map_queue)
return -EINVAL;

if (set->queue_depth > BLK_MQ_MAX_DEPTH) {

This is already fixed in for-4.1/core.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/