Skip to content

Commit 4c97f04

Browse files
Dawei LiWim Van Sebroeck
authored andcommitted
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: Dawei Li <set_pte_at@outlook.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/TYTP286MB3564B037A81DAAE1AC3A16F3CA062@TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent e3b3afd commit 4c97f04

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/watchdog/octeon-wdt-main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,7 @@ static int octeon_wdt_cpu_online(unsigned int cpu)
381381

382382
/* Must set the irq affinity here */
383383
if (octeon_has_feature(OCTEON_FEATURE_CIU3)) {
384-
cpumask_t mask;
385-
386-
cpumask_clear(&mask);
387-
cpumask_set_cpu(cpu, &mask);
388-
irq_set_affinity(irq, &mask);
384+
irq_set_affinity(irq, cpumask_of(cpu));
389385
}
390386

391387
cpumask_set_cpu(cpu, &irq_enabled_cpus);

0 commit comments

Comments
 (0)