From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Thorsten Blum" <blum@kernel.org>,
"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
"Derek J . Clark" <derekjohn.clark@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: ibm-acpi-devel@lists.sourceforge.net,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Remove unreachable code in beep_read()
Date: Wed, 09 Sep 2026 11:26:18 -0400 [thread overview]
Message-ID: <254d9c60-d21e-4ef5-b70e-89dd18ff7147@app.fastmail.com> (raw)
In-Reply-To: <20260907090103.352995-3-blum@kernel.org>
Hi Thorsten,
On Mon, Sep 7, 2026, at 5:01 AM, Thorsten Blum wrote:
> The procfs entry /proc/acpi/ibm/beep is only created if beep_init()
> succeeds, which requires beep_handle to be non-NULL. Remove the
> unreachable code branch from beep_read().
>
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
> drivers/platform/x86/lenovo/thinkpad_acpi.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index 1082c36ae723..069c9f1c359f 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -5936,12 +5936,8 @@ static int __init beep_init(struct
> ibm_init_struct *iibm)
>
> static int beep_read(struct seq_file *m)
> {
> - if (!beep_handle)
> - seq_puts(m, "status:\t\tnot supported\n");
> - else {
> - seq_puts(m, "status:\t\tsupported\n");
> - seq_puts(m, "commands:\t<cmd> (<cmd> is 0-17)\n");
> - }
> + seq_puts(m, "status:\t\tsupported\n");
> + seq_puts(m, "commands:\t<cmd> (<cmd> is 0-17)\n");
>
> return 0;
> }
Change looks good to me.
I guess the beep_write could be similarly updated?
Mark
next prev parent reply other threads:[~2026-09-09 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 9:01 Thorsten Blum
2026-09-09 15:26 ` Mark Pearson [this message]
2026-09-09 16:49 ` Thorsten Blum
2026-09-10 0:58 ` Mark Pearson
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=254d9c60-d21e-4ef5-b70e-89dd18ff7147@app.fastmail.com \
--to=mpearson-lenovo@squebb.ca \
--cc=blum@kernel.org \
--cc=derekjohn.clark@gmail.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®