]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ACPI / NUMA: move acpi_numa_slit_init() to drivers/acpi/numa.c
authorHanjun Guo <hanjun.guo@linaro.org>
Tue, 24 May 2016 22:35:35 +0000 (15:35 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 May 2016 12:27:07 +0000 (14:27 +0200)
Identical implementations of acpi_numa_slit_init() are used by both
x86 and follow-on arm64 support.  Move it to drivers/acpi/numa.c, and
guard with CONFIG_X86 || CONFIG_ARM64 because ia64 has its own
architecture specific implementation.

No code change.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/x86/mm/srat.c
drivers/acpi/numa.c

index 90b6ed9a00dc9222be1ecf21192156466343af81..f242a11df488fd57b912b854a04d5d27322d915a 100644 (file)
@@ -42,33 +42,6 @@ static __init inline int srat_disabled(void)
        return acpi_numa < 0;
 }
 
-/*
- * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
- * I/O localities since SRAT does not list them.  I/O localities are
- * not supported at this point.
- */
-void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
-{
-       int i, j;
-
-       for (i = 0; i < slit->locality_count; i++) {
-               const int from_node = pxm_to_node(i);
-
-               if (from_node == NUMA_NO_NODE)
-                       continue;
-
-               for (j = 0; j < slit->locality_count; j++) {
-                       const int to_node = pxm_to_node(j);
-
-                       if (to_node == NUMA_NO_NODE)
-                               continue;
-
-                       numa_set_distance(from_node, to_node,
-                               slit->entry[slit->locality_count * i + j]);
-               }
-       }
-}
-
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
 acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
index fb2c0d61f252ab4bd1e24f4fc12208d3ee864260..7e0649d11da2a567ba8c961c3756aeeb49974899 100644 (file)
@@ -197,6 +197,35 @@ static int __init slit_valid(struct acpi_table_slit *slit)
        return 1;
 }
 
+#if defined(CONFIG_X86) || defined(CONFIG_ARM64)
+/*
+ * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
+ * I/O localities since SRAT does not list them.  I/O localities are
+ * not supported at this point.
+ */
+void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
+{
+       int i, j;
+
+       for (i = 0; i < slit->locality_count; i++) {
+               const int from_node = pxm_to_node(i);
+
+               if (from_node == NUMA_NO_NODE)
+                       continue;
+
+               for (j = 0; j < slit->locality_count; j++) {
+                       const int to_node = pxm_to_node(j);
+
+                       if (to_node == NUMA_NO_NODE)
+                               continue;
+
+                       numa_set_distance(from_node, to_node,
+                               slit->entry[slit->locality_count * i + j]);
+               }
+       }
+}
+#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */
+
 static int __init acpi_parse_slit(struct acpi_table_header *table)
 {
        struct acpi_table_slit *slit = (struct acpi_table_slit *)table;