cpumask: x86: 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.

Also makes __pcibus_to_node take a const pointer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Rusty Russell
2008-12-26 22:23:38 +10:30
parent d62720ade8
commit 393d68fb99
3 changed files with 35 additions and 18 deletions

View File

@@ -98,9 +98,9 @@ static inline void early_quirks(void) { }
#ifdef CONFIG_NUMA
/* Returns the node based on pci bus */
static inline int __pcibus_to_node(struct pci_bus *bus)
static inline int __pcibus_to_node(const struct pci_bus *bus)
{
struct pci_sysdata *sd = bus->sysdata;
const struct pci_sysdata *sd = bus->sysdata;
return sd->node;
}
@@ -109,6 +109,12 @@ static inline cpumask_t __pcibus_to_cpumask(struct pci_bus *bus)
{
return node_to_cpumask(__pcibus_to_node(bus));
}
static inline const struct cpumask *
cpumask_of_pcibus(const struct pci_bus *bus)
{
return cpumask_of_node(__pcibus_to_node(bus));
}
#endif
#endif /* _ASM_X86_PCI_H */