From 1827f3f06aafe67c1d273025a26390d9d2bdd3f7 Mon Sep 17 00:00:00 2001 From: Yurii Pavlovskyi Date: Tue, 14 May 2019 21:03:50 +0200 Subject: [PATCH] platform/x86: asus-wmi: Refactor error handling Remove exit label as it is only used once from the point in code where no cleanup is required and return can be called immediately. Signed-off-by: Yurii Pavlovskyi Signed-off-by: Andy Shevchenko --- drivers/platform/x86/asus-wmi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 83bf145..5cbd7fc 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -255,7 +255,7 @@ static int asus_wmi_evaluate_method3(u32 method_id, &input, &output); if (ACPI_FAILURE(status)) - goto exit; + return -EIO; obj = (union acpi_object *)output.pointer; if (obj && obj->type == ACPI_TYPE_INTEGER) @@ -266,10 +266,6 @@ static int asus_wmi_evaluate_method3(u32 method_id, kfree(obj); -exit: - if (ACPI_FAILURE(status)) - return -EIO; - if (tmp == ASUS_WMI_UNSUPPORTED_METHOD) return -ENODEV; -- 2.7.4