Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86 / ACPI / NUMA: cleanup acpi_numa_processor_affinity_init()

Cleanup acpi_numa_processor_affinity_init() in preparation for its
move to drivers/acpi/numa.c. It will be reused by arm64, this has no
functional 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>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
2faeff1d 34c33370

+5 -16
+5 -16
arch/x86/mm/srat.c
··· 26 26 27 27 int acpi_numa __initdata; 28 28 29 - static __init int setup_node(int pxm) 30 - { 31 - return acpi_map_pxm_to_node(pxm); 32 - } 33 - 34 29 static __init void bad_srat(void) 35 30 { 36 31 printk(KERN_ERR "SRAT: SRAT not used.\n"); ··· 59 64 pxm, apic_id); 60 65 return; 61 66 } 62 - node = setup_node(pxm); 67 + node = acpi_map_pxm_to_node(pxm); 63 68 if (node < 0) { 64 69 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 65 70 bad_srat(); ··· 95 100 pxm = pa->proximity_domain_lo; 96 101 if (acpi_srat_revision >= 2) 97 102 pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8; 98 - node = setup_node(pxm); 103 + node = acpi_map_pxm_to_node(pxm); 99 104 if (node < 0) { 100 105 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 101 106 bad_srat(); ··· 119 124 pxm, apic_id, node); 120 125 } 121 126 122 - #ifdef CONFIG_MEMORY_HOTPLUG 123 - static inline int save_add_info(void) {return 1;} 124 - #else 125 - static inline int save_add_info(void) {return 0;} 126 - #endif 127 - 128 127 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ 129 128 int __init 130 129 acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) ··· 134 145 if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0) 135 146 goto out_err; 136 147 hotpluggable = ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE; 137 - if (hotpluggable && !save_add_info()) 148 + if (hotpluggable && !IS_ENABLED(CONFIG_MEMORY_HOTPLUG)) 138 149 goto out_err; 139 150 140 151 start = ma->base_address; ··· 143 154 if (acpi_srat_revision <= 1) 144 155 pxm &= 0xff; 145 156 146 - node = setup_node(pxm); 157 + node = acpi_map_pxm_to_node(pxm); 147 158 if (node < 0) { 148 159 printk(KERN_ERR "SRAT: Too many proximity domains.\n"); 149 160 goto out_err_bad_srat; ··· 171 182 out_err_bad_srat: 172 183 bad_srat(); 173 184 out_err: 174 - return -1; 185 + return -EINVAL; 175 186 } 176 187 177 188 int __init x86_acpi_numa_init(void)