Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Patch to arch/mips/sibyte/sb1250/irq.c
@ 2005-08-24 17:45 Mark Mason
  0 siblings, 0 replies; only message in thread
From: Mark Mason @ 2005-08-24 17:45 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

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



[-- Attachment #2: irq-patch --]
[-- Type: text/plain, Size: 1466 bytes --]

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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-24 17:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24 17:45 Patch to arch/mips/sibyte/sb1250/irq.c Mark Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox