ia64: Use for_each_cpu_and() and cpumask_any_and() instead of temp var.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 5 Mar 2015 00:18:49 +0000 (10:48 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 5 Mar 2015 03:07:01 +0000 (13:37 +1030)
Just a bit of manual neatening, before spatch cleans the rest.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/msi_ia64.c

index 698d8fefde6c2591071be0dd0ccc7d64bca8703e..3329177c262e895faff53d1cf30156bec18d10ff 100644 (file)
@@ -161,7 +161,6 @@ int bind_irq_vector(int irq, int vector, cpumask_t domain)
 static void __clear_irq_vector(int irq)
 {
        int vector, cpu;
-       cpumask_t mask;
        cpumask_t domain;
        struct irq_cfg *cfg = &irq_cfg[irq];
 
@@ -169,8 +168,7 @@ static void __clear_irq_vector(int irq)
        BUG_ON(cfg->vector == IRQ_VECTOR_UNASSIGNED);
        vector = cfg->vector;
        domain = cfg->domain;
-       cpumask_and(&mask, &cfg->domain, cpu_online_mask);
-       for_each_cpu_mask(cpu, mask)
+       for_each_cpu_and(cpu, &cfg->domain, cpu_online_mask)
                per_cpu(vector_irq, cpu)[vector] = -1;
        cfg->vector = IRQ_VECTOR_UNASSIGNED;
        cfg->domain = CPU_MASK_NONE;
index 8ae36ea177d3eb97524f99a64897a2c5a4a2146e..9dd7464f8c1742848011ce1397ef8a79f1e60d4f 100644 (file)
@@ -47,15 +47,14 @@ int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
        struct msi_msg  msg;
        unsigned long   dest_phys_id;
        int     irq, vector;
-       cpumask_t mask;
 
        irq = create_irq();
        if (irq < 0)
                return irq;
 
        irq_set_msi_desc(irq, desc);
-       cpumask_and(&mask, &(irq_to_domain(irq)), cpu_online_mask);
-       dest_phys_id = cpu_physical_id(first_cpu(mask));
+       dest_phys_id = cpu_physical_id(cpumask_any_and(&(irq_to_domain(irq)),
+                                                      cpu_online_mask));
        vector = irq_to_vector(irq);
 
        msg.address_hi = 0;
@@ -171,10 +170,9 @@ msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg)
 {
        struct irq_cfg *cfg = irq_cfg + irq;
        unsigned dest;
-       cpumask_t mask;
 
-       cpumask_and(&mask, &(irq_to_domain(irq)), cpu_online_mask);
-       dest = cpu_physical_id(first_cpu(mask));
+       dest = cpu_physical_id(cpumask_first_and(&(irq_to_domain(irq)),
+                                                cpu_online_mask));
 
        msg->address_hi = 0;
        msg->address_lo =