diff mbox series

[6/7] platform/x86: thinkpad_acpi: Remove "goto err_exit" from hotkey_init()

Message ID 20211121191129.256713-7-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Headers show
Series thinkpad_acpi: 1 bugfix + a bunch of cleanups | expand

Commit Message

Hans de Goede Nov. 21, 2021, 7:11 p.m. UTC
The err_exit label just does a:
 return (res < 0) ? res : -ENODEV;

And res is always < 0 when we go there (hotkey_mask_get() returns
either 0 or -EIO), so the goto-s can simply be replaced with
"return res".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index acfe08e7dc3f..9f45949fb3e9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3466,7 +3466,7 @@  static int __init hotkey_init(struct ibm_init_struct *iibm)
 		 * the first hotkey_mask_get to return hotkey_orig_mask */
 		res = hotkey_mask_get();
 		if (res)
-			goto err_exit;
+			return res;
 
 		hotkey_orig_mask = hotkey_acpi_mask;
 	} else {
@@ -3502,8 +3502,7 @@  static int __init hotkey_init(struct ibm_init_struct *iibm)
 			TPACPI_HOTKEY_MAP_SIZE,	GFP_KERNEL);
 	if (!hotkey_keycode_map) {
 		pr_err("failed to allocate memory for key map\n");
-		res = -ENOMEM;
-		goto err_exit;
+		return -ENOMEM;
 	}
 
 	input_set_capability(tpacpi_inputdev, EV_MSC, MSC_SCAN);
@@ -3584,9 +3583,6 @@  static int __init hotkey_init(struct ibm_init_struct *iibm)
 	hotkey_poll_setup_safe(true);
 
 	return 0;
-
-err_exit:
-	return (res < 0) ? res : -ENODEV;
 }
 
 /* Thinkpad X1 Carbon support 5 modes including Home mode, Web browser