[PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto
From: Eduardo Vasconcelos
Date: Sat Apr 25 2026 - 02:40:39 EST
Remove an unneeded goto statement in hotkey_kthread(). Since
the function has a single exit location with no cleanup code,
the jump provides no benefit. Per the kernel coding style,
returning directly is preferred over goto in such case [1].
[1] https://www.kernel.org/doc/html/latest/process/coding-style.html
Signed-off-by: Eduardo Vasconcelos <eduardo@xxxxxxxxxxxxxxxxxxxxxx>
Tested-by: Eduardo Vasconcelos <eduardo@xxxxxxxxxxxxxxxxxxxxxx> (T420si)
---
drivers/platform/x86/lenovo/thinkpad_acpi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index e1cee42a1683..d4ed6f1216f2 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -2469,7 +2469,7 @@ static int hotkey_kthread(void *data)
bool was_frozen;
if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
- goto exit;
+ return 0;
set_freezable();
@@ -2526,7 +2526,6 @@ static int hotkey_kthread(void *data)
si ^= 1;
}
-exit:
return 0;
}
--
2.54.0