linux-mips
[Top] [All Lists]

Patch to arch/mips/sibyte/sb1250/irq.c

To: linux-mips@linux-mips.org
Subject: Patch to arch/mips/sibyte/sb1250/irq.c
From: "Mark Mason" <mason@broadcom.com>
Date: Wed, 24 Aug 2005 10:45:13 -0700
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
Hello all,

Attached is a patch to the sb1250 version of irq.c to fix compilation warnings (and make the code more correct).

Change sb1250_set_affinity() to use the proper datatype and access macros for the cpu mask.

Thanks,
Mark


Index: arch/mips/sibyte/sb1250/irq.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sibyte/sb1250/irq.c,v
retrieving revision 1.34
diff -u -p -r1.34 irq.c
--- arch/mips/sibyte/sb1250/irq.c       11 Jul 2005 10:03:30 -0000      1.34
+++ arch/mips/sibyte/sb1250/irq.c       24 Aug 2005 17:33:33 -0000
@@ -53,7 +53,7 @@ static void disable_sb1250_irq(unsigned 
 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,26 +117,19 @@ void sb1250_unmask_irq(int cpu, 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)
 {
-       int i = 0, old_cpu, cpu, int_on;
+       int i = 0, old_cpu, cpu, int_on, weight;
        u64 cur_ints;
        irq_desc_t *desc = irq_desc + irq;
        unsigned long flags;
 
-       while (mask) {
-               if (mask & 1) {
-                       mask >>= 1;
-                       break;
-               }
-               mask >>= 1;
-               i++;
-       }
-
-       if (mask) {
+       weight = cpus_weight(mask);
+       if (weight > 1) {
                printk("attempted to set irq affinity for irq %d to multiple 
CPUs\n", irq);
                return;
-       }
+       } else if (weight != 0)
+               i = first_cpu(mask);
 
        /* Convert logical CPU to physical CPU */
        cpu = cpu_logical_map(i);
<Prev in Thread] Current Thread [Next in Thread>
  • Patch to arch/mips/sibyte/sb1250/irq.c, Mark Mason <=