Skip to content

Commit

Permalink
sparc/of: Remove on-stack cpumask var
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Sam Ravnborg <[email protected]>
Signed-off-by: Dawei Li <[email protected]>
Reviewed-by: Andreas Larsson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Andreas Larsson <[email protected]>
  • Loading branch information
Dawei Li authored and andreas-gaisler committed May 8, 2024
1 parent c4650ba commit 3e4b2f0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/sparc/kernel/of_device_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,7 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
out:
nid = of_node_to_nid(dp);
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));
}

return irq;
Expand Down

0 comments on commit 3e4b2f0

Please sign in to comment.