Skip to content

Commit

Permalink
Xen / ACPI / processor: use invalid_logical_cpuid()
Browse files Browse the repository at this point in the history
Use invalid_logical_cpuid(pr->id) instead of direct comparison.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
hanjun-guo authored and rafaeljw committed May 13, 2015
1 parent 25956b6 commit 16eac05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/xen/xen-acpi-cpuhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int xen_acpi_processor_enable(struct acpi_device *device)

pr->id = xen_pcpu_id(pr->acpi_id);

if ((int)pr->id < 0)
if (invalid_logical_cpuid(pr->id))
/* This cpu is not presented at hypervisor, try to hotadd it */
if (ACPI_FAILURE(xen_acpi_cpu_hotadd(pr))) {
pr_err(PREFIX "Hotadd CPU (acpi_id = %d) failed.\n",
Expand Down Expand Up @@ -226,7 +226,7 @@ static acpi_status xen_acpi_cpu_hotadd(struct acpi_processor *pr)
return AE_ERROR;

pr->id = xen_hotadd_cpu(pr);
if ((int)pr->id < 0)
if (invalid_logical_cpuid(pr->id))
return AE_ERROR;

/*
Expand Down

0 comments on commit 16eac05

Please sign in to comment.