ACPI / processor: return specific error instead of -1
authorHanjun Guo <hanjun.guo@linaro.org>
Mon, 11 May 2015 04:17:18 +0000 (12:17 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 May 2015 21:28:16 +0000 (23:28 +0200)
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>
drivers/acpi/processor_core.c

index b1ec78b8a6455c68f08af8123a529e5513475b03..fd4140dabbf1cd4e7098c15f36b9f8a803c809d7 100644 (file)
@@ -215,12 +215,12 @@ int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id)
                 * Ignores phys_id and always returns 0 for the processor
                 * handle with acpi id 0 if nr_cpu_ids is 1.
                 * This should be the case if SMP tables are not found.
-                * Return -1 for other CPU's handle.
+                * Return -EINVAL for other CPU's handle.
                 */
                if (nr_cpu_ids <= 1 && acpi_id == 0)
                        return acpi_id;
                else
-                       return -1;
+                       return -EINVAL;
        }
 
 #ifdef CONFIG_SMP
@@ -233,7 +233,7 @@ int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id)
        if (phys_id == 0)
                return phys_id;
 #endif
-       return -1;
+       return -ENODEV;
 }
 
 int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)