diff options
author | Kyle McMartin <kyle@shortfin.cabal.ca> | 2009-02-16 03:20:54 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@treachery.i.cabal.ca> | 2009-03-13 01:20:27 -0400 |
commit | 8b6649c575e0d8312f62fe643ae43558892da2e1 (patch) | |
tree | efbb8966d9b607ac9d46113255e792f645d05d49 | |
parent | 9dfe914da83ebc88f85d94b4d30d0e45882766d1 (diff) |
parisc: convert cpu_check_affinity to new cpumask api
cpumask arg to the affinity function is now const, sort
that out through the irq_desc implementations.
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
-rw-r--r-- | arch/parisc/include/asm/irq.h | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/irq.c | 12 | ||||
-rw-r--r-- | drivers/parisc/iosapic.c | 7 |
3 files changed, 13 insertions, 8 deletions
diff --git a/arch/parisc/include/asm/irq.h b/arch/parisc/include/asm/irq.h index 399c81981ed5..dfa26b67f919 100644 --- a/arch/parisc/include/asm/irq.h +++ b/arch/parisc/include/asm/irq.h | |||
@@ -49,7 +49,7 @@ extern unsigned long txn_alloc_addr(unsigned int); | |||
49 | extern unsigned long txn_affinity_addr(unsigned int irq, int cpu); | 49 | extern unsigned long txn_affinity_addr(unsigned int irq, int cpu); |
50 | 50 | ||
51 | extern int cpu_claim_irq(unsigned int irq, struct irq_chip *, void *); | 51 | extern int cpu_claim_irq(unsigned int irq, struct irq_chip *, void *); |
52 | extern int cpu_check_affinity(unsigned int irq, cpumask_t *dest); | 52 | extern int cpu_check_affinity(unsigned int irq, const struct cpumask *dest); |
53 | 53 | ||
54 | /* soft power switch support (power.c) */ | 54 | /* soft power switch support (power.c) */ |
55 | extern struct tasklet_struct power_tasklet; | 55 | extern struct tasklet_struct power_tasklet; |
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index a572112f5aba..29e70e16ede8 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c | |||
@@ -112,7 +112,7 @@ void cpu_end_irq(unsigned int irq) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | #ifdef CONFIG_SMP | 114 | #ifdef CONFIG_SMP |
115 | int cpu_check_affinity(unsigned int irq, cpumask_t *dest) | 115 | int cpu_check_affinity(unsigned int irq, const struct cpumask *dest) |
116 | { | 116 | { |
117 | int cpu_dest; | 117 | int cpu_dest; |
118 | 118 | ||
@@ -126,17 +126,19 @@ int cpu_check_affinity(unsigned int irq, cpumask_t *dest) | |||
126 | 126 | ||
127 | /* whatever mask they set, we just allow one CPU */ | 127 | /* whatever mask they set, we just allow one CPU */ |
128 | cpu_dest = first_cpu(*dest); | 128 | cpu_dest = first_cpu(*dest); |
129 | *dest = cpumask_of_cpu(cpu_dest); | ||
130 | 129 | ||
131 | return 0; | 130 | return cpu_dest; |
132 | } | 131 | } |
133 | 132 | ||
134 | static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest) | 133 | static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest) |
135 | { | 134 | { |
136 | if (cpu_check_affinity(irq, dest)) | 135 | int cpu_dest; |
136 | |||
137 | cpu_dest = cpu_check_affinity(irq, dest); | ||
138 | if (cpu_dest < 0) | ||
137 | return; | 139 | return; |
138 | 140 | ||
139 | cpumask_copy(&irq_desc[irq].affinity, dest); | 141 | cpumask_copy(&irq_desc[irq].affinity, &cpumask_of_cpu(cpu_dest)); |
140 | } | 142 | } |
141 | #endif | 143 | #endif |
142 | 144 | ||
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 1cdfdea5d7ef..501aaf1f253f 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
@@ -708,11 +708,14 @@ static void iosapic_set_affinity_irq(unsigned int irq, | |||
708 | struct vector_info *vi = iosapic_get_vector(irq); | 708 | struct vector_info *vi = iosapic_get_vector(irq); |
709 | u32 d0, d1, dummy_d0; | 709 | u32 d0, d1, dummy_d0; |
710 | unsigned long flags; | 710 | unsigned long flags; |
711 | int dest_cpu; | ||
711 | 712 | ||
712 | if (cpu_check_affinity(irq, dest)) | 713 | dest_cpu = cpu_check_affinity(irq, dest); |
714 | if (dest_cpu < 0) | ||
713 | return; | 715 | return; |
714 | 716 | ||
715 | vi->txn_addr = txn_affinity_addr(irq, cpumask_first(dest)); | 717 | irq_desc[irq].affinity = cpumask_of_cpu(dest_cpu); |
718 | vi->txn_addr = txn_affinity_addr(irq, dest_cpu); | ||
716 | 719 | ||
717 | spin_lock_irqsave(&iosapic_lock, flags); | 720 | spin_lock_irqsave(&iosapic_lock, flags); |
718 | /* d1 contains the destination CPU, so only want to set that | 721 | /* d1 contains the destination CPU, so only want to set that |