* [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() @ 2026-02-20 13:30 ` Maurizio Lombardi 2026-02-20 14:32 ` Kanchan Joshi ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Maurizio Lombardi @ 2026-02-20 13:30 UTC (permalink / raw) To: kbusch; +Cc: linux-nvme, dwagner, mlombard 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. Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> --- drivers/nvme/host/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 19b67cf5d550..8798a51f735c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4845,7 +4845,6 @@ EXPORT_SYMBOL_GPL(nvme_complete_async_event); int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, const struct blk_mq_ops *ops, unsigned int cmd_size) { - struct queue_limits lim = {}; int ret; memset(set, 0, sizeof(*set)); @@ -4865,7 +4864,7 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, if (ret) return ret; - ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL); + ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL); if (IS_ERR(ctrl->admin_q)) { ret = PTR_ERR(ctrl->admin_q); goto out_free_tagset; -- 2.53.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() 2026-02-20 13:30 ` [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() Maurizio Lombardi @ 2026-02-20 14:32 ` Kanchan Joshi 2026-03-10 13:17 ` Maurizio Lombardi 2026-03-10 14:27 ` Keith Busch 2 siblings, 0 replies; 4+ messages in thread From: Kanchan Joshi @ 2026-02-20 14:32 UTC (permalink / raw) To: Maurizio Lombardi, kbusch; +Cc: linux-nvme, dwagner, mlombard Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() 2026-02-20 13:30 ` [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() Maurizio Lombardi 2026-02-20 14:32 ` Kanchan Joshi @ 2026-03-10 13:17 ` Maurizio Lombardi 2026-03-10 14:27 ` Keith Busch 2 siblings, 0 replies; 4+ messages in thread From: Maurizio Lombardi @ 2026-03-10 13:17 UTC (permalink / raw) To: Maurizio Lombardi, kbusch; +Cc: linux-nvme, dwagner, mlombard Keith? Can you review this? Thanks, Maurizio On Fri Feb 20, 2026 at 2:30 PM CET, Maurizio Lombardi wrote: > 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. > > Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> > --- > drivers/nvme/host/core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 19b67cf5d550..8798a51f735c 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -4845,7 +4845,6 @@ EXPORT_SYMBOL_GPL(nvme_complete_async_event); > int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, > const struct blk_mq_ops *ops, unsigned int cmd_size) > { > - struct queue_limits lim = {}; > int ret; > > memset(set, 0, sizeof(*set)); > @@ -4865,7 +4864,7 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, > if (ret) > return ret; > > - ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL); > + ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL); > if (IS_ERR(ctrl->admin_q)) { > ret = PTR_ERR(ctrl->admin_q); > goto out_free_tagset; ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() 2026-02-20 13:30 ` [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() Maurizio Lombardi 2026-02-20 14:32 ` Kanchan Joshi 2026-03-10 13:17 ` Maurizio Lombardi @ 2026-03-10 14:27 ` Keith Busch 2 siblings, 0 replies; 4+ messages in thread From: Keith Busch @ 2026-03-10 14:27 UTC (permalink / raw) To: Maurizio Lombardi; +Cc: linux-nvme, dwagner, mlombard On Fri, Feb 20, 2026 at 02:30:16PM +0100, Maurizio Lombardi wrote: > 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(). Thanks, applied. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-10 14:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20260220133056epcas5p1f981cf74d0f768d1251fdcac73fbca5f@epcas5p1.samsung.com>
2026-02-20 13:30 ` [PATCH] nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue() Maurizio Lombardi
2026-02-20 14:32 ` Kanchan Joshi
2026-03-10 13:17 ` Maurizio Lombardi
2026-03-10 14:27 ` Keith Busch
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox