Skip to contentSkip to conversation

genirq: use cpumask_intersects

PATCH Applied Costa Shulyupin 3 participants 3 messages Sep 4, 2024 – Sep 6, 2024 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: use cpumask_intersects

Replace cpumask_any_and(a, b) >= nr_cpu_ids
with more readable !cpumask_intersects(a, b).

---
 kernel/irq/cpuhotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/cpuhotplug.c +2 -2
index eb86283901565..15a7654eff684 100644
@@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
 	 * has been removed from the online mask already.
 	 */
 	if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
-	    cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
+	    !cpumask_intersects(m, cpu_online_mask)) {
 		/*
 		 * If this happens then there was a missed IRQ fixup at some
 		 * point. Warn about it and enforce fixup.
@@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	if (maskchip && chip->irq_mask)
 		chip->irq_mask(d);
 
-	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+	if (!cpumask_intersects(affinity, cpu_online_mask)) {
 		/*
 		 * If the interrupt is managed, then shut it down and leave
 		 * the affinity untouched.
Signature · 1 line
2.45.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Costa Shulyupin

Replace cpumask_any_and(a, b) >= nr_cpu_ids
with more readable !cpumask_intersects(a, b).

---
 kernel/irq/cpuhotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/cpuhotplug.c +1 -1
index eb86283901565..15a7654eff684 100644
@@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
         * has been removed from the online mask already.
         */
        if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
-           cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
+           !cpumask_intersects(m, cpu_online_mask)) {
                /*
                 * If this happens then there was a missed IRQ fixup at some
                 * point. Warn about it and enforce fixup.

kernel/irq/cpuhotplug.c static bool migrate_one_irq(struct irq_desc *desc) · line 116

Quoted 8 lines
kernel/irq/cpuhotplug.c +1 -1
@@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
        if (maskchip && chip->irq_mask)
                chip->irq_mask(d);
 
-       if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+       if (!cpumask_intersects(affinity, cpu_online_mask)) {
                /*
                 * If the interrupt is managed, then shut it down and leave
                 * the affinity untouched.

Looks fine,

Thanks,

#2 lore raw

[tip: irq/core] genirq/cpuhotplug: Use cpumask_intersects()

In reply to Costa Shulyupin
The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     87b5a153b862b7d937fc1dd499368297a1feae87
Gitweb:        https://git.kernel.org/tip/87b5a153b862b7d937fc1dd499368297a1feae87
Author:        Costa Shulyupin <[email protected]>
AuthorDate:    Wed, 04 Sep 2024 16:48:23 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 06 Sep 2024 16:28:39 +02:00

genirq/cpuhotplug: Use cpumask_intersects()

Replace cpumask_any_and(a, b) >= nr_cpu_ids with the more readable !cpumask_intersects(a, b).

[ tglx: Massaged change log ]

---
 kernel/irq/cpuhotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/cpuhotplug.c +2 -2
index eb86283..15a7654 100644
@@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
 	 * has been removed from the online mask already.
 	 */
 	if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
-	    cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
+	    !cpumask_intersects(m, cpu_online_mask)) {
 		/*
 		 * If this happens then there was a missed IRQ fixup at some
 		 * point. Warn about it and enforce fixup.
@@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	if (maskchip && chip->irq_mask)
 		chip->irq_mask(d);
 
-	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+	if (!cpumask_intersects(affinity, cpu_online_mask)) {
 		/*
 		 * If the interrupt is managed, then shut it down and leave
 		 * the affinity untouched.