* [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto
@ 2026-04-25 6:39 Eduardo Vasconcelos
2026-04-25 12:49 ` Mark Pearson
2026-04-28 16:06 ` Ilpo Järvinen
0 siblings, 2 replies; 3+ messages in thread
From: Eduardo Vasconcelos @ 2026-04-25 6:39 UTC (permalink / raw)
To: mpearson-lenovo, derekjohn.clark, hmh, hansg, ilpo.jarvinen
Cc: Eduardo Vasconcelos, platform-driver-x86, ibm-acpi-devel, linux-kernel
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@eduardovasconcelos.com>
Tested-by: Eduardo Vasconcelos <eduardo@eduardovasconcelos.com> (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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto
2026-04-25 6:39 [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto Eduardo Vasconcelos
@ 2026-04-25 12:49 ` Mark Pearson
2026-04-28 16:06 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Mark Pearson @ 2026-04-25 12:49 UTC (permalink / raw)
To: Eduardo Vasconcelos, Derek J . Clark,
Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, ibm-acpi-devel, linux-kernel
On Sat, Apr 25, 2026, at 2:39 AM, Eduardo Vasconcelos wrote:
> 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@eduardovasconcelos.com>
> Tested-by: Eduardo Vasconcelos <eduardo@eduardovasconcelos.com> (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
Looks good to me. Thanks!
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto
2026-04-25 6:39 [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto Eduardo Vasconcelos
2026-04-25 12:49 ` Mark Pearson
@ 2026-04-28 16:06 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2026-04-28 16:06 UTC (permalink / raw)
To: mpearson-lenovo, derekjohn.clark, hmh, hansg, Eduardo Vasconcelos
Cc: platform-driver-x86, ibm-acpi-devel, linux-kernel
On Sat, 25 Apr 2026 03:39:34 -0300, Eduardo Vasconcelos wrote:
> 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
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: thinkpad_acpi: Remove unneeded goto
commit: 74ab7c4d73d526bfebc6f3fd7382c6f672d8b912
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-28 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-25 6:39 [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto Eduardo Vasconcelos
2026-04-25 12:49 ` Mark Pearson
2026-04-28 16:06 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®