diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:38 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-26 06:53:38 -0500 |
commit | 96d76a74870d5f11ce2abdd09a8dcdc401d714d1 (patch) | |
tree | efb10f0e18c29d0c177a13c66953bc20ed86dcf1 /arch | |
parent | 393d68fb9929817cde7ab31c82d66fcb28ad35fc (diff) |
cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
Impact: New APIs
The old node_to_cpumask/node_to_pcibus returned a cpumask_t: these
return a pointer to a struct cpumask. Part of removing cpumasks from
the stack.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/include/asm/topology_64.h | 10 | ||||
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_msi.c | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h index 001c04027c82..afd3cc1824d7 100644 --- a/arch/sparc/include/asm/topology_64.h +++ b/arch/sparc/include/asm/topology_64.h | |||
@@ -16,8 +16,12 @@ static inline cpumask_t node_to_cpumask(int node) | |||
16 | { | 16 | { |
17 | return numa_cpumask_lookup_table[node]; | 17 | return numa_cpumask_lookup_table[node]; |
18 | } | 18 | } |
19 | #define cpumask_of_node(node) (&numa_cpumask_lookup_table[node]) | ||
19 | 20 | ||
20 | /* Returns a pointer to the cpumask of CPUs on Node 'node'. */ | 21 | /* |
22 | * Returns a pointer to the cpumask of CPUs on Node 'node'. | ||
23 | * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" | ||
24 | */ | ||
21 | #define node_to_cpumask_ptr(v, node) \ | 25 | #define node_to_cpumask_ptr(v, node) \ |
22 | cpumask_t *v = &(numa_cpumask_lookup_table[node]) | 26 | cpumask_t *v = &(numa_cpumask_lookup_table[node]) |
23 | 27 | ||
@@ -26,9 +30,7 @@ static inline cpumask_t node_to_cpumask(int node) | |||
26 | 30 | ||
27 | static inline int node_to_first_cpu(int node) | 31 | static inline int node_to_first_cpu(int node) |
28 | { | 32 | { |
29 | cpumask_t tmp; | 33 | return cpumask_first(cpumask_of_node(node)); |
30 | tmp = node_to_cpumask(node); | ||
31 | return first_cpu(tmp); | ||
32 | } | 34 | } |
33 | 35 | ||
34 | struct pci_bus; | 36 | struct pci_bus; |
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index df2efb7fc14c..4f6098d318ec 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
@@ -778,7 +778,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
778 | out: | 778 | out: |
779 | nid = of_node_to_nid(dp); | 779 | nid = of_node_to_nid(dp); |
780 | if (nid != -1) { | 780 | if (nid != -1) { |
781 | cpumask_t numa_mask = node_to_cpumask(nid); | 781 | cpumask_t numa_mask = *cpumask_of_node(nid); |
782 | 782 | ||
783 | irq_set_affinity(irq, &numa_mask); | 783 | irq_set_affinity(irq, &numa_mask); |
784 | } | 784 | } |
diff --git a/arch/sparc64/kernel/pci_msi.c b/arch/sparc64/kernel/pci_msi.c index 0d0cd815e83e..4ef282e81912 100644 --- a/arch/sparc64/kernel/pci_msi.c +++ b/arch/sparc64/kernel/pci_msi.c | |||
@@ -286,7 +286,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm, | |||
286 | 286 | ||
287 | nid = pbm->numa_node; | 287 | nid = pbm->numa_node; |
288 | if (nid != -1) { | 288 | if (nid != -1) { |
289 | cpumask_t numa_mask = node_to_cpumask(nid); | 289 | cpumask_t numa_mask = *cpumask_of_node(nid); |
290 | 290 | ||
291 | irq_set_affinity(irq, &numa_mask); | 291 | irq_set_affinity(irq, &numa_mask); |
292 | } | 292 | } |