linux-mips
[Top] [All Lists]

[patch 2/5] SiByte fixes for 2.6.12

To: linux-mips@linux-mips.org
Subject: [patch 2/5] SiByte fixes for 2.6.12
From: "Andrew Isaacson" <adi@broadcom.com>
Date: Wed, 22 Jun 2005 16:01:09 -0700
In-reply-to: <20050622230003.GA17725@broadcom.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
Update sb1250_set_affinity to use cpumask_t rather than hand-rolled
bitmask code.

Signed-Off-By: Andrew Isaacson <adi@broadcom.com>

Index: linux-2.6-work/arch/mips/sibyte/sb1250/irq.c
===================================================================
--- linux-2.6-work.orig/arch/mips/sibyte/sb1250/irq.c   2005-06-22 
11:17:21.000000000 -0700
+++ linux-2.6-work/arch/mips/sibyte/sb1250/irq.c        2005-06-22 
11:17:30.000000000 -0700
@@ -53,7 +53,7 @@
 static unsigned int startup_sb1250_irq(unsigned int irq);
 static void ack_sb1250_irq(unsigned int irq);
 #ifdef CONFIG_SMP
-static void sb1250_set_affinity(unsigned int irq, unsigned long mask);
+static void sb1250_set_affinity(unsigned int irq, cpumask_t mask);
 #endif
 
 #ifdef CONFIG_SIBYTE_HAS_LDT
@@ -117,23 +117,16 @@
 }
 
 #ifdef CONFIG_SMP
-static void sb1250_set_affinity(unsigned int irq, unsigned long mask)
+static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
 {
        int i = 0, old_cpu, cpu, int_on;
        u64 cur_ints;
        irq_desc_t *desc = irq_desc + irq;
        unsigned long flags;
 
-       while (mask) {
-               if (mask & 1) {
-                       mask >>= 1;
-                       break;
-               }
-               mask >>= 1;
-               i++;
-       }
+       i = first_cpu(mask);
 
-       if (mask) {
+       if (cpus_weight(mask) > 1) {
                printk("attempted to set irq affinity for irq %d to multiple 
CPUs\n", irq);
                return;
        }

--



<Prev in Thread] Current Thread [Next in Thread>