All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul()
@ 2016-12-02 17:42 Andy Shevchenko
  2016-12-02 17:42 ` [PATCH v1 2/2] ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s Andy Shevchenko
  2016-12-08  0:12 ` [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2016-12-02 17:42 UTC (permalink / raw)
  To: linux-acpi, Rafael J. Wysocki; +Cc: Andy Shevchenko

There is no need to override the error code returned by kstrtoul().
Propagate it directly to the caller.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/osl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 4d8f2cd..35230cd 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -181,9 +181,7 @@ void acpi_os_vprintf(const char *fmt, va_list args)
 static unsigned long acpi_rsdp;
 static int __init setup_acpi_rsdp(char *arg)
 {
-	if (kstrtoul(arg, 16, &acpi_rsdp))
-		return -EINVAL;
-	return 0;
+	return kstrtoul(arg, 16, &acpi_rsdp);
 }
 early_param("acpi_rsdp", setup_acpi_rsdp);
 #endif
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s
  2016-12-02 17:42 [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Andy Shevchenko
@ 2016-12-02 17:42 ` Andy Shevchenko
  2016-12-08  0:12 ` [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2016-12-02 17:42 UTC (permalink / raw)
  To: linux-acpi, Rafael J. Wysocki; +Cc: Andy Shevchenko

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>
---
 drivers/acpi/osl.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 35230cd..5bef0f65 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. */
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul()
  2016-12-02 17:42 [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Andy Shevchenko
  2016-12-02 17:42 ` [PATCH v1 2/2] ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s Andy Shevchenko
@ 2016-12-08  0:12 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2016-12-08  0:12 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: ACPI Devel Maling List, Rafael J. Wysocki

On Fri, Dec 2, 2016 at 6:42 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There is no need to override the error code returned by kstrtoul().
> Propagate it directly to the caller.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Both this and the [2/2] applied.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-08  0:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02 17:42 [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Andy Shevchenko
2016-12-02 17:42 ` [PATCH v1 2/2] ACPI / osl: Refactor acpi_os_get_root_pointer() to drop 'else':s Andy Shevchenko
2016-12-08  0:12 ` [PATCH v1 1/2] ACPI / osl: Propagate actual error code for kstrtoul() Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.