summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-12-02 19:42:47 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-12-06 22:13:58 +0100
commit2fb65f09c2c6eaba5fcf848aa615f4837d540576 (patch)
tree3589139e21a178b74a440027fa6861bfa3e7da81 /drivers/acpi
parent5dcb9ca8403c31f4a9a6e21b0057be3bdefb7414 (diff)
ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s
There are few 'else' keywords which are redundant in acpi_os_get_root_pointer(). Refactor function to get rid of them. While here, switch to pr_err() instead of printk(KERN_ERR ...). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/osl.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index d47df72990dd..9a4c6abee63e 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -188,6 +188,8 @@ early_param("acpi_rsdp", setup_acpi_rsdp);
acpi_physical_address __init acpi_os_get_root_pointer(void)
{
+ acpi_physical_address pa = 0;
+
#ifdef CONFIG_KEXEC
if (acpi_rsdp)
return acpi_rsdp;
@@ -196,21 +198,14 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
if (efi_enabled(EFI_CONFIG_TABLES)) {
if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
return efi.acpi20;
- else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+ if (efi.acpi != EFI_INVALID_TABLE_ADDR)
return efi.acpi;
- else {
- printk(KERN_ERR PREFIX
- "System description tables not found\n");
- return 0;
- }
+ pr_err(PREFIX "System description tables not found\n");
} else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
- acpi_physical_address pa = 0;
-
acpi_find_root_pointer(&pa);
- return pa;
}
- return 0;
+ return pa;
}
/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */