Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Maurizio Lombardi and committed by
Keith Busch
0375c81e fc71f409

+1 -2
+1 -2
drivers/nvme/host/core.c
··· 4834 4834 int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, 4835 4835 const struct blk_mq_ops *ops, unsigned int cmd_size) 4836 4836 { 4837 - struct queue_limits lim = {}; 4838 4837 int ret; 4839 4838 4840 4839 memset(set, 0, sizeof(*set)); ··· 4860 4861 if (ctrl->admin_q) 4861 4862 blk_put_queue(ctrl->admin_q); 4862 4863 4863 - ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL); 4864 + ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL); 4864 4865 if (IS_ERR(ctrl->admin_q)) { 4865 4866 ret = PTR_ERR(ctrl->admin_q); 4866 4867 goto out_free_tagset;