Skip to content

Commit

Permalink
cpumask: sparc: Introduce cpumask_of_{node,pcibus} to replace {node,p…
Browse files Browse the repository at this point in the history
…cibus}_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>
  • Loading branch information
Rusty Russell committed Dec 26, 2008
1 parent 393d68f commit 96d76a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions arch/sparc/include/asm/topology_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ static inline cpumask_t node_to_cpumask(int node)
{
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])

Expand All @@ -26,9 +30,7 @@ static inline cpumask_t node_to_cpumask(int node)

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;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
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);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/pci_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm,

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);
}
Expand Down

0 comments on commit 96d76a7

Please sign in to comment.