From 6314e4704f535644812d40b91ea2315ad32841c7 Mon Sep 17 00:00:00 2001 From: Richard Sailer Date: Sun, 24 Nov 2019 12:22:20 +0100 Subject: [PATCH] Control flow cleanup: avoid goto + better error messages --- src/tuxedo_keyboard.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/tuxedo_keyboard.c b/src/tuxedo_keyboard.c index a231fff..b1ebfd7 100644 --- a/src/tuxedo_keyboard.c +++ b/src/tuxedo_keyboard.c @@ -274,8 +274,8 @@ static int tuxedo_evaluate_wmi_method(u32 method_id, u32 arg, u32 * retval) &acpi_input, &acpi_output); if (unlikely(ACPI_FAILURE(status))) { - TUXEDO_ERROR("evaluate method error"); - goto exit; + TUXEDO_ERROR("evaluate_wmi_method error"); + return -EIO; } obj = (union acpi_object *)acpi_output.pointer; @@ -292,12 +292,6 @@ static int tuxedo_evaluate_wmi_method(u32 method_id, u32 arg, u32 * retval) } kfree(obj); - -exit: - if (unlikely(ACPI_FAILURE(status))) { - return -EIO; - } - return 0; }