Commit 4c97f043 authored by Dawei Li's avatar Dawei Li Committed by Wim Van Sebroeck

watchdog/wdt-main: Use cpumask_of() to avoid cpumask var on stack

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.

Use cpumask_of() to avoid the need for a temporary cpumask on the stack
Signed-off-by: default avatarDawei Li <set_pte_at@outlook.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/TYTP286MB3564B037A81DAAE1AC3A16F3CA062@TYTP286MB3564.JPNP286.PROD.OUTLOOK.COMSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent e3b3afd3
...@@ -381,11 +381,7 @@ static int octeon_wdt_cpu_online(unsigned int cpu) ...@@ -381,11 +381,7 @@ static int octeon_wdt_cpu_online(unsigned int cpu)
/* Must set the irq affinity here */ /* Must set the irq affinity here */
if (octeon_has_feature(OCTEON_FEATURE_CIU3)) { if (octeon_has_feature(OCTEON_FEATURE_CIU3)) {
cpumask_t mask; irq_set_affinity(irq, cpumask_of(cpu));
cpumask_clear(&mask);
cpumask_set_cpu(cpu, &mask);
irq_set_affinity(irq, &mask);
} }
cpumask_set_cpu(cpu, &irq_enabled_cpus); cpumask_set_cpu(cpu, &irq_enabled_cpus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment