On Tuesday 09 December 2014 00:53:06 Hanjun Guo wrote:
diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c new file mode 100644 index 0000000..d0245de --- /dev/null +++ b/arch/arm64/kernel/acpi_numa.c @@ -0,0 +1,176 @@ +/*
- ACPI 5.1 based NUMA setup for ARM64
- Lots of code was borrowed from arch/x86/mm/srat.c
I think you need to return what you borrowed ;-)
Can the ACPI table parsing code just be moved to drivers/acpi for sharing? Is this different between x86 and ia64?
+#ifdef CONFIG_ARM64_DT_NUMA /**
- early_init_dt_scan_numa_map - parse memory node and map nid to memory range.
*/ @@ -576,7 +617,7 @@ int __init early_init_dt_scan_numa_map(unsigned long node, const char *uname, cpue = dt_mem_next_cell(nr_size_cells, &numa_prop); node_id = dt_mem_next_cell(nr_size_cells, &numa_prop); for (j = cpus; j <= cpue; j++)
cpu_info[j].node_id = node_id;
pr_debug("NUMA-DT: start cpu = %d end cpu = %d node-id %d\n", cpus, cpue, node_id); }node_cpuid[j].node_id = node_id;
@@ -610,6 +651,9 @@ static inline int __init arm64_dt_numa_init(void) { return of_scan_flat_dt(early_init_dt_scan_numa_map, NULL); } +#else +static inline int __init arm64_dt_numa_init(void) { return -EINVAL; } +#endif
Please try to avoid adding #ifdef sequences like this and instead use something like
if (!IS_ENABLED(CONFIG_ARM64_DT_NUMA)) return -ENXIO;
or change the caller to only call this function like this.
Arnd