From: Thorsten Blum <thorsten.blum@linux.dev>
To: "Mark Pearson" <mpearson-lenovo@squebb.ca>,
"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: Thorsten Blum <thorsten.blum@linux.dev>,
platform-driver-x86@vger.kernel.org,
ibm-acpi-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86: thinkpad_acpi: Use bool for str_supported() parameter
Date: Thu, 6 Aug 2026 15:15:50 +0200 [thread overview]
Message-ID: <20260806131549.235170-2-thorsten.blum@linux.dev> (raw)
Make str_supported() take a bool, define it inline, and return string
literals directly. Use a single inline definition for both debug and
non-debug builds.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/platform/x86/lenovo/thinkpad_acpi.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index 445e1403308e..022353f95cab 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -448,11 +448,14 @@ do { \
__func__, ##arg); \
} while (0)
+static inline const char * __init str_supported(bool is_supported)
+{
+ return is_supported ? "supported" : "not supported";
+}
+
#ifdef CONFIG_THINKPAD_ACPI_DEBUG
#define vdbg_printk dbg_printk
-static const char *str_supported(int is_supported);
#else
-static inline const char *str_supported(int is_supported) { return ""; }
#define vdbg_printk(a_dbg_level, format, arg...) \
do { if (0) no_printk(format, ##arg); } while (0)
#endif
@@ -5798,7 +5801,7 @@ static int __init led_init(struct ibm_init_struct *iibm)
}
vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n",
- str_supported(led_supported), led_supported);
+ str_supported(led_supported != TPACPI_LED_NONE), led_supported);
if (led_supported == TPACPI_LED_NONE)
return -ENODEV;
@@ -11515,15 +11518,6 @@ static struct proc_dir_entry *proc_dir;
static bool force_load;
-#ifdef CONFIG_THINKPAD_ACPI_DEBUG
-static const char * __init str_supported(int is_supported)
-{
- static char text_unsupported[] __initdata = "not supported";
-
- return (is_supported) ? &text_unsupported[4] : &text_unsupported[0];
-}
-#endif /* CONFIG_THINKPAD_ACPI_DEBUG */
-
static struct dentry *tpacpi_dbg;
static void tpacpi_debugfs_init(void)
{
reply other threads:[~2026-08-06 13:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260806131549.235170-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--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=mpearson-lenovo@squebb.ca \
--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