From: Mao Minkai maominkai@wxiat.com
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG
--------------------------------
CONFIG_USE_PERCPU_NUMA_NODE_ID is always y, remove redundant code.
Signed-off-by: Mao Minkai maominkai@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com Acked-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/sw_64/include/asm/topology.h | 18 ------------------ arch/sw_64/kernel/core.c | 23 ++--------------------- 2 files changed, 2 insertions(+), 39 deletions(-)
diff --git a/arch/sw_64/include/asm/topology.h b/arch/sw_64/include/asm/topology.h index 38b3c98ec155..9f45b550abca 100644 --- a/arch/sw_64/include/asm/topology.h +++ b/arch/sw_64/include/asm/topology.h @@ -32,24 +32,6 @@ static inline int rcid_to_package(int rcid)
#ifdef CONFIG_NUMA
-#ifndef CONFIG_USE_PERCPU_NUMA_NODE_ID -extern int cpuid_to_nid(int cpuid); -static inline int cpu_to_node(int cpu) -{ - int node; - - node = cpuid_to_nid(cpu); - -#ifdef DEBUG_NUMA - BUG_ON(node < 0); -#endif - - return node; -} - -static inline void set_cpu_numa_node(int cpu, int node) { } -#endif /* CONFIG_USE_PERCPU_NUMA_NODE_ID */ - #ifndef CONFIG_DEBUG_PER_CPU_MAPS extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; /* Returns a pointer to the cpumask of CPUs on Node 'node'. */ diff --git a/arch/sw_64/kernel/core.c b/arch/sw_64/kernel/core.c index 4a35c1dc1e19..4d440de68aae 100644 --- a/arch/sw_64/kernel/core.c +++ b/arch/sw_64/kernel/core.c @@ -20,8 +20,8 @@ #endif #include "pci_impl.h"
-#ifdef CONFIG_NUMA #ifdef CONFIG_DISCONTIGMEM +#ifdef CONFIG_NUMA int pa_to_nid(unsigned long pa) { int i = 0; @@ -43,30 +43,11 @@ int pa_to_nid(unsigned long pa) return 0; } EXPORT_SYMBOL(pa_to_nid); -#endif /* CONFIG_DISCONTIGMEM */ - -#ifndef CONFIG_USE_PERCPU_NUMA_NODE_ID -extern int cpu_to_node_map[NR_CPUS]; -int cpuid_to_nid(int cpuid) -{ - return cpu_to_node_map[cpuid]; -} -EXPORT_SYMBOL(cpuid_to_nid); -#endif /* CONFIG_USE_PERCPU_NUMA_NODE_ID */ #else /* !CONFIG_NUMA */ -#ifdef CONFIG_DISCONTIGMEM int pa_to_nid(unsigned long pa) { return 0; } EXPORT_SYMBOL(pa_to_nid); -#endif /* CONFIG_DISCONTIGMEM */ - -#ifndef CONFIG_USE_PERCPU_NUMA_NODE_ID -int cpuid_to_nid(int cpuid) -{ - return 0; -} -EXPORT_SYMBOL(cpuid_to_nid); -#endif /* CONFIG_USE_PERCPU_NUMA_NODE_ID */ #endif /* CONFIG_NUMA */ +#endif /* CONFIG_DISCONTIGMEM */