Skip to content

Commit a6fe30d

Browse files
makelinuxKAGA-KOKO
authored andcommitted
genirq: Use cpumask_intersects()
Replace `cpumask_any_and(a, b) >= nr_cpu_ids` and `cpumask_any_and(a, b) < nr_cpu_ids` with the more readable `!cpumask_intersects(a, b)` and `cpumask_intersects(a, b)` Signed-off-by: Costa Shulyupin <costa.shul@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20240906170142.1135207-1-costa.shul@redhat.com
1 parent 87b5a15 commit a6fe30d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

kernel/irq/chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ __irq_startup_managed(struct irq_desc *desc, const struct cpumask *aff,
198198

199199
irqd_clr_managed_shutdown(d);
200200

201-
if (cpumask_any_and(aff, cpu_online_mask) >= nr_cpu_ids) {
201+
if (!cpumask_intersects(aff, cpu_online_mask)) {
202202
/*
203203
* Catch code which fiddles with enable_irq() on a managed
204204
* and potentially shutdown IRQ. Chained interrupt

kernel/irq/migration.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear)
2626
* The outgoing CPU might be the last online target in a pending
2727
* interrupt move. If that's the case clear the pending move bit.
2828
*/
29-
if (cpumask_any_and(desc->pending_mask, cpu_online_mask) >= nr_cpu_ids) {
29+
if (!cpumask_intersects(desc->pending_mask, cpu_online_mask)) {
3030
irqd_clr_move_pending(data);
3131
return false;
3232
}
@@ -74,7 +74,7 @@ void irq_move_masked_irq(struct irq_data *idata)
7474
* For correct operation this depends on the caller
7575
* masking the irqs.
7676
*/
77-
if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) {
77+
if (cpumask_intersects(desc->pending_mask, cpu_online_mask)) {
7878
int ret;
7979

8080
ret = irq_do_set_affinity(data, desc->pending_mask, false);

0 commit comments

Comments
 (0)