sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dawei Li <dawei.li@shingroup.cn>
To: davem@davemloft.net, andreas@gaisler.com
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
	sam@ravnborg.org, Dawei Li <dawei.li@shingroup.cn>
Subject: [PATCH v2 4/7] sparc/pci_msi: Remove on-stack cpumask var
Date: Sat, 20 Apr 2024 13:15:44 +0800	[thread overview]
Message-ID: <20240420051547.3681642-5-dawei.li@shingroup.cn> (raw)
In-Reply-To: <20240420051547.3681642-1-dawei.li@shingroup.cn>

In general it's preferable to avoid placing cpumasks on the stack, as
for large values of NR_CPUS these can consume significant amounts of
stack space and make stack overflows more likely.

@cpumask of irq_set_affinity() is read-only and free of change, drop
unneeded cpumask var.

Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
---
 arch/sparc/kernel/pci_msi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
index fc7402948b7b..acb2f83a1d5c 100644
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -287,10 +287,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm,
 
 	nid = pbm->numa_node;
 	if (nid != -1) {
-		cpumask_t numa_mask;
-
-		cpumask_copy(&numa_mask, cpumask_of_node(nid));
-		irq_set_affinity(irq, &numa_mask);
+		irq_set_affinity(irq, cpumask_of_node(nid));
 	}
 	err = request_irq(irq, sparc64_msiq_interrupt, 0,
 			  "MSIQ",
-- 
2.27.0


  parent reply	other threads:[~2024-04-20  5:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20  5:15 [PATCH v2 0/7] Remove onstack cpumask var for sparc Dawei Li
2024-04-20  5:15 ` [PATCH v2 1/7] sparc/srmmu: Remove on-stack cpumask var Dawei Li
2024-04-20  7:58   ` Sam Ravnborg
2024-04-22  5:46     ` Dawei Li
2024-04-20  5:15 ` [PATCH v2 2/7] sparc/irq: " Dawei Li
2024-04-20  8:22   ` Sam Ravnborg
2024-04-20  5:15 ` [PATCH v2 3/7] sparc/of: " Dawei Li
2024-04-20  8:23   ` Sam Ravnborg
2024-04-20  5:15 ` Dawei Li [this message]
2024-04-20  8:23   ` [PATCH v2 4/7] sparc/pci_msi: " Sam Ravnborg
2024-04-20  5:15 ` [PATCH v2 5/7] sparc: " Dawei Li
2024-04-20  8:28   ` Sam Ravnborg
2024-04-22  5:49     ` Dawei Li
2024-04-20  5:15 ` [PATCH v2 6/7] sparc/leon: " Dawei Li
2024-04-20  8:32   ` Sam Ravnborg
2024-04-22  6:15     ` Dawei Li
2024-04-20  5:15 ` [PATCH v2 7/7] sparc/smp: " Dawei Li
2024-04-20 11:42   ` Sam Ravnborg
2024-04-22  6:19     ` Dawei Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240420051547.3681642-5-dawei.li@shingroup.cn \
    --to=dawei.li@shingroup.cn \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).