diff options
author | Samuel Holland <samuel@sholland.org> | 2022-07-01 23:00:55 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-07-07 11:38:04 +0300 |
commit | 4d0b8298818b623f5fa51d5c49e1a142d3618ac9 (patch) | |
tree | e2e495e4d10f7b5d097dae7d637dc1e6f07773c1 /arch/sh | |
parent | 073352e951f60946452da358d64841066c3142ff (diff) | |
download | linux-4d0b8298818b623f5fa51d5c49e1a142d3618ac9.tar.xz |
genirq: Return a const cpumask from irq_data_get_affinity_mask
Now that the irq_data_update_affinity helper exists, enforce its use
by returning a a const cpumask from irq_data_get_affinity_mask.
Since the previous commit already updated places that needed to call
irq_data_update_affinity, this commit updates the remaining code that
either did not modify the cpumask or immediately passed the modified
mask to irq_set_affinity.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220701200056.46555-8-samuel@sholland.org
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/irq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index ef0f0827cf57..56269c2c3414 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -230,16 +230,17 @@ void migrate_irqs(void) struct irq_data *data = irq_get_irq_data(irq); if (irq_data_get_node(data) == cpu) { - struct cpumask *mask = irq_data_get_affinity_mask(data); + const struct cpumask *mask = irq_data_get_affinity_mask(data); unsigned int newcpu = cpumask_any_and(mask, cpu_online_mask); if (newcpu >= nr_cpu_ids) { pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n", irq, cpu); - cpumask_setall(mask); + irq_set_affinity(irq, cpu_all_mask); + } else { + irq_set_affinity(irq, mask); } - irq_set_affinity(irq, mask); } } } |