From: Jayachandran C Date: Sat, 21 Dec 2013 11:22:17 +0000 (+0530) Subject: MIPS: Netlogic: Add macro for node present X-Git-Tag: next-20140116~105^2^2~39 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f269e679ad55121444a68c81da2d3d904a80b785;p=karo-tx-linux.git MIPS: Netlogic: Add macro for node present Add macro nlm_node_present() that can be used to check if a node is present in a multi-chip configuration. This can be used even when NUMA is not enabled. Signed-off-by: Jayachandran C Acked-by: John Crispin Patchwork: http://patchwork.linux-mips.org/patch/6272/ --- diff --git a/arch/mips/include/asm/mach-netlogic/multi-node.h b/arch/mips/include/asm/mach-netlogic/multi-node.h index b3d91e0c10dd..beeb36b9f9f8 100644 --- a/arch/mips/include/asm/mach-netlogic/multi-node.h +++ b/arch/mips/include/asm/mach-netlogic/multi-node.h @@ -63,6 +63,8 @@ struct nlm_soc_info { extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; #define nlm_get_node(i) (&nlm_nodes[i]) +#define nlm_node_present(n) ((n) >= 0 && (n) < NLM_NR_NODES && \ + nlm_get_node(n)->coremask != 0) #ifdef CONFIG_CPU_XLR #define nlm_current_node() (&nlm_nodes[0]) #else diff --git a/arch/mips/pci/pci-xlp.c b/arch/mips/pci/pci-xlp.c index 222d804e77d1..da7a37a55981 100644 --- a/arch/mips/pci/pci-xlp.c +++ b/arch/mips/pci/pci-xlp.c @@ -235,7 +235,6 @@ static inline void xlp_config_pci_bswap(int node, int link) {} static int __init pcibios_init(void) { - struct nlm_soc_info *nodep; uint64_t pciebase; int link, n; u32 reg; @@ -249,9 +248,8 @@ static int __init pcibios_init(void) ioport_resource.end = ~0; for (n = 0; n < NLM_NR_NODES; n++) { - nodep = nlm_get_node(n); - if (!nodep->coremask) - continue; /* node does not exist */ + if (!nlm_node_present(n)) + continue; for (link = 0; link < PCIE_NLINKS; link++) { pciebase = nlm_get_pcie_base(n, link);