* [PATCH 7/8] cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
@ 2008-11-21 11:36 Rusty Russell
2008-11-21 12:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2008-11-21 11:36 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-kernel
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>
Cc: David S. Miller <davem@davemloft.net>
---
arch/sparc/include/asm/topology_64.h | 10 ++++++----
arch/sparc64/kernel/of_device.c | 2 +-
arch/sparc64/kernel/pci_msi.c | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
--- linux-2.6.orig/arch/sparc/include/asm/topology_64.h
+++ linux-2.6/arch/sparc/include/asm/topology_64.h
@@ -16,8 +16,12 @@ static inline cpumask_t node_to_cpumask(
{
return numa_cpumask_lookup_table[node];
}
+#define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
-/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
+/*
+ * Returns a pointer to the cpumask of CPUs on Node 'node'.
+ * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
+ */
#define node_to_cpumask_ptr(v, node) \
cpumask_t *v = &(numa_cpumask_lookup_table[node])
@@ -26,9 +30,7 @@ static inline cpumask_t node_to_cpumask(
static inline int node_to_first_cpu(int node)
{
- cpumask_t tmp;
- tmp = node_to_cpumask(node);
- return first_cpu(tmp);
+ return cpumask_first(cpumask_of_node(node));
}
struct pci_bus;
--- linux-2.6.orig/arch/sparc64/kernel/of_device.c
+++ linux-2.6/arch/sparc64/kernel/of_device.c
@@ -778,7 +778,7 @@ static unsigned int __init build_one_dev
out:
nid = of_node_to_nid(dp);
if (nid != -1) {
- cpumask_t numa_mask = node_to_cpumask(nid);
+ cpumask_t numa_mask = *cpumask_of_node(nid);
irq_set_affinity(irq, numa_mask);
}
--- linux-2.6.orig/arch/sparc64/kernel/pci_msi.c
+++ linux-2.6/arch/sparc64/kernel/pci_msi.c
@@ -286,7 +286,7 @@ static int bringup_one_msi_queue(struct
nid = pbm->numa_node;
if (nid != -1) {
- cpumask_t numa_mask = node_to_cpumask(nid);
+ cpumask_t numa_mask = *cpumask_of_node(nid);
irq_set_affinity(irq, numa_mask);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 7/8] cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
2008-11-21 11:36 [PATCH 7/8] cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask Rusty Russell
@ 2008-11-21 12:09 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-11-21 12:09 UTC (permalink / raw)
To: rusty; +Cc: linux-kernel
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Fri, 21 Nov 2008 22:06:04 +1030
>
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-21 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21 11:36 [PATCH 7/8] cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask Rusty Russell
2008-11-21 12:09 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.