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

ACPI / processor: return specific error instead of -1

Since invalid_logical_cpuid() can check error values, so
return specific error instead of -1 for acpi_map_cpuid().

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
d3da7cb9 8416c5bd

+3 -3
+3 -3
drivers/acpi/processor_core.c
··· 215 215 * Ignores phys_id and always returns 0 for the processor 216 216 * handle with acpi id 0 if nr_cpu_ids is 1. 217 217 * This should be the case if SMP tables are not found. 218 - * Return -1 for other CPU's handle. 218 + * Return -EINVAL for other CPU's handle. 219 219 */ 220 220 if (nr_cpu_ids <= 1 && acpi_id == 0) 221 221 return acpi_id; 222 222 else 223 - return -1; 223 + return -EINVAL; 224 224 } 225 225 226 226 #ifdef CONFIG_SMP ··· 233 233 if (phys_id == 0) 234 234 return phys_id; 235 235 #endif 236 - return -1; 236 + return -ENODEV; 237 237 } 238 238 239 239 int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)