From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Eduardo Vasconcelos" <eduardo@eduardovasconcelos.com>,
"Derek J . Clark" <derekjohn.clark@gmail.com>,
"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
ibm-acpi-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Remove unneeded goto
Date: Sat, 25 Apr 2026 08:49:07 -0400 [thread overview]
Message-ID: <16d45e47-8234-4983-84d4-91b66c5a67db@app.fastmail.com> (raw)
In-Reply-To: <20260425063936.9360-1-eduardo@eduardovasconcelos.com>
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>
next prev parent reply other threads:[~2026-04-25 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 6:39 Eduardo Vasconcelos
2026-04-25 12:49 ` Mark Pearson [this message]
2026-04-28 16:06 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16d45e47-8234-4983-84d4-91b66c5a67db@app.fastmail.com \
--to=mpearson-lenovo@squebb.ca \
--cc=derekjohn.clark@gmail.com \
--cc=eduardo@eduardovasconcelos.com \
--cc=hansg@kernel.org \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®