mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Thorsten Blum" <blum@kernel.org>
Cc: "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>,
	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 20:58:03 -0400	[thread overview]
Message-ID: <0bd026b6-3fa9-4f62-adf3-ac0a491b6d53@app.fastmail.com> (raw)
In-Reply-To: <aqGOLBx_hU3a7ADQ@kernel.org>

On Wed, Sep 9, 2026, at 12:49 PM, Thorsten Blum wrote:
> On Wed, Sep 09, 2026 at 11:26:18AM -0400, Mark Pearson wrote:
>> 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?
>
> No, beep_write() can be called via the beep= module parameter even if
> beep_init() failed, so that check is still needed.
>

Oh - good point, I had missed that.
With that noted:
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Thanks
Mark

      reply	other threads:[~2026-09-10  0:58 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
2026-09-09 16:49   ` Thorsten Blum
2026-09-10  0:58     ` Mark Pearson [this message]

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=0bd026b6-3fa9-4f62-adf3-ac0a491b6d53@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®