mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Remove unreachable code in beep_read()
@ 2026-09-07  9:01 Thorsten Blum
  2026-09-09 15:26 ` Mark Pearson
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-07  9:01 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh, Mark Pearson, Derek J. Clark,
	Hans de Goede, Ilpo Järvinen
  Cc: Thorsten Blum, ibm-acpi-devel, platform-driver-x86, linux-kernel

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;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-10  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07  9:01 [PATCH] platform/x86: thinkpad_acpi: Remove unreachable code in beep_read() Thorsten Blum
2026-09-09 15:26 ` Mark Pearson
2026-09-09 16:49   ` Thorsten Blum
2026-09-10  0:58     ` Mark Pearson

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®