summaryrefslogtreecommitdiff
path: root/drivers/acpi/processor_pdc.c
diff options
context:
space:
mode:
authorHanjun Guo <hanjun.guo@linaro.org>2015-05-11 07:17:13 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-05-14 00:28:14 +0300
commit25956b6612601cf36022392ffa83f6bf97939bcd (patch)
treef3b8efbce1c45c7ccf5796e38046f13477d22a76 /drivers/acpi/processor_pdc.c
parent030bbdbf4c833bc69f502eae58498bc5572db736 (diff)
downloadlinux-25956b6612601cf36022392ffa83f6bf97939bcd.tar.xz
ACPI / processor: Introduce invalid_logical_cpuid()
In ACPI processor drivers, we use direct comparisons of cpu logical id with -1 which are error prone in case logical cpuid is accidentally assinged an error code and prevents us from returning an error-encoding cpuid directly in some cases. So introduce invalid_logical_cpuid() to identify cpu with invalid logical cpu num, then it will be used to replace the direct comparisons with -1. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/processor_pdc.c')
-rw-r--r--drivers/acpi/processor_pdc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c
index e5dd80800930..7cfbda4d7c51 100644
--- a/drivers/acpi/processor_pdc.c
+++ b/drivers/acpi/processor_pdc.c
@@ -52,10 +52,7 @@ static bool __init processor_physically_present(acpi_handle handle)
type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
cpuid = acpi_get_cpuid(handle, type, acpi_id);
- if (cpuid == -1)
- return false;
-
- return true;
+ return !invalid_logical_cpuid(cpuid);
}
static void acpi_set_pdc_bits(u32 *buf)