platform/x86: asus-wmi: Refactor error handling
authorYurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
Tue, 14 May 2019 19:03:50 +0000 (21:03 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Jun 2019 12:22:47 +0000 (15:22 +0300)
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 <yurii.pavlovskyi@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c

index 83bf145..5cbd7fc 100644 (file)
@@ -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;