[PATCH v2 3/4] ARM64: ACPI: Make acpi_numa_get_nid() invisible to kernel/smp.c

Hanjun Guo guohanjun at huawei.com
Sat Aug 10 21:23:02 PDT 2024


To do the preparation of moving acpi_numa.c to drivers/acpi/arm64,
Make acpi_numa_get_nid() invisible to kernel/smp.c, with less
export functions.

Signed-off-by: Hanjun Guo <guohanjun at huawei.com>
---
 arch/arm64/include/asm/acpi.h | 2 --
 arch/arm64/kernel/acpi_numa.c | 8 +++++++-
 arch/arm64/kernel/smp.c       | 5 -----
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 5e25110ad1b7..40a501e1f26b 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -175,10 +175,8 @@ static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
 #endif /* CONFIG_ACPI_APEI */
 
 #ifdef CONFIG_ACPI_NUMA
-int acpi_numa_get_nid(unsigned int cpu);
 void acpi_map_cpus_to_nodes(void);
 #else
-static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
 static inline void acpi_map_cpus_to_nodes(void) { }
 #endif /* CONFIG_ACPI_NUMA */
 
diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
index 0c036a9a3c33..2e55ff02bf07 100644
--- a/arch/arm64/kernel/acpi_numa.c
+++ b/arch/arm64/kernel/acpi_numa.c
@@ -29,7 +29,7 @@
 
 static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
 
-int __init acpi_numa_get_nid(unsigned int cpu)
+static int __init acpi_numa_get_nid(unsigned int cpu)
 {
 	return acpi_early_node_map[cpu];
 }
@@ -72,9 +72,15 @@ static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header,
 
 void __init acpi_map_cpus_to_nodes(void)
 {
+	int i;
+
 	acpi_table_parse_entries(ACPI_SIG_SRAT, sizeof(struct acpi_table_srat),
 					    ACPI_SRAT_TYPE_GICC_AFFINITY,
 					    acpi_parse_gicc_pxm, 0);
+
+	for (i = 0; i < nr_cpu_ids; i++)
+		early_map_cpu_to_node(i, acpi_numa_get_nid(i));
+
 }
 
 /* Callback for Proximity Domain -> ACPI processor UID mapping */
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 5e18fbcee9a2..b717b77ed4d6 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -650,8 +650,6 @@ acpi_parse_gic_cpu_interface(union acpi_subtable_headers *header,
 
 static void __init acpi_parse_and_init_cpus(void)
 {
-	int i;
-
 	/*
 	 * do a walk of MADT to determine how many CPUs
 	 * we have including disabled CPUs, and get information
@@ -669,9 +667,6 @@ static void __init acpi_parse_and_init_cpus(void)
 	 * as separate steps.
 	 */
 	acpi_map_cpus_to_nodes();
-
-	for (i = 0; i < nr_cpu_ids; i++)
-		early_map_cpu_to_node(i, acpi_numa_get_nid(i));
 }
 #else
 #define acpi_parse_and_init_cpus(...)	do { } while (0)
-- 
2.25.1




More information about the linux-arm-kernel mailing list