Skip to content

Commit 0375c81

Browse files
maurizio-lombardikeithbusch
authored andcommitted
nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue()
In nvme_alloc_admin_tag_set(), an empty queue_limits struct is currently allocated on the stack and passed by reference to blk_mq_alloc_queue(). This is redundant because blk_mq_alloc_queue() already handles a NULL limits pointer by internally substituting it with a default empty queue_limits struct. Remove the unnecessary local variable and pass a NULL value. Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent fc71f40 commit 0375c81

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4834,7 +4834,6 @@ EXPORT_SYMBOL_GPL(nvme_complete_async_event);
48344834
int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
48354835
const struct blk_mq_ops *ops, unsigned int cmd_size)
48364836
{
4837-
struct queue_limits lim = {};
48384837
int ret;
48394838

48404839
memset(set, 0, sizeof(*set));
@@ -4861,7 +4860,7 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
48614860
if (ctrl->admin_q)
48624861
blk_put_queue(ctrl->admin_q);
48634862

4864-
ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL);
4863+
ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL);
48654864
if (IS_ERR(ctrl->admin_q)) {
48664865
ret = PTR_ERR(ctrl->admin_q);
48674866
goto out_free_tagset;

0 commit comments

Comments
 (0)