diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2016-12-02 12:42:47 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-06 16:13:58 -0500 |
commit | 2fb65f09c2c6eaba5fcf848aa615f4837d540576 (patch) | |
tree | 3589139e21a178b74a440027fa6861bfa3e7da81 | |
parent | 5dcb9ca8403c31f4a9a6e21b0057be3bdefb7414 (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>
-rw-r--r-- | drivers/acpi/osl.c | 15 |
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); | |||
188 | 188 | ||
189 | acpi_physical_address __init acpi_os_get_root_pointer(void) | 189 | acpi_physical_address __init acpi_os_get_root_pointer(void) |
190 | { | 190 | { |
191 | acpi_physical_address pa = 0; | ||
192 | |||
191 | #ifdef CONFIG_KEXEC | 193 | #ifdef CONFIG_KEXEC |
192 | if (acpi_rsdp) | 194 | if (acpi_rsdp) |
193 | return acpi_rsdp; | 195 | return acpi_rsdp; |
@@ -196,21 +198,14 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) | |||
196 | if (efi_enabled(EFI_CONFIG_TABLES)) { | 198 | if (efi_enabled(EFI_CONFIG_TABLES)) { |
197 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) | 199 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) |
198 | return efi.acpi20; | 200 | return efi.acpi20; |
199 | else if (efi.acpi != EFI_INVALID_TABLE_ADDR) | 201 | if (efi.acpi != EFI_INVALID_TABLE_ADDR) |
200 | return efi.acpi; | 202 | return efi.acpi; |
201 | else { | 203 | pr_err(PREFIX "System description tables not found\n"); |
202 | printk(KERN_ERR PREFIX | ||
203 | "System description tables not found\n"); | ||
204 | return 0; | ||
205 | } | ||
206 | } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { | 204 | } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { |
207 | acpi_physical_address pa = 0; | ||
208 | |||
209 | acpi_find_root_pointer(&pa); | 205 | acpi_find_root_pointer(&pa); |
210 | return pa; | ||
211 | } | 206 | } |
212 | 207 | ||
213 | return 0; | 208 | return pa; |
214 | } | 209 | } |
215 | 210 | ||
216 | /* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */ | 211 | /* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */ |