mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
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>,
	"Kees Cook" <kees@kernel.org>,
	"Andy Shevchenko" <andy@kernel.org>
Cc: platform-driver-x86@vger.kernel.org,
	ibm-acpi-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
	Thorsten Blum <blum@kernel.org>
Subject: [PATCH v2 1/2] lib/string_choices: Add str_supported_unsupported() helper
Date: Mon,  7 Sep 2026 10:43:20 +0200	[thread overview]
Message-ID: <20260907084319.351688-5-blum@kernel.org> (raw)
In-Reply-To: <20260907084319.351688-4-blum@kernel.org>

Add str_supported_unsupported() to return "supported" or "unsupported"
depending on the boolean argument. Also add the inverse
str_unsupported_supported().

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 include/linux/string_choices.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index ee84087d4b26..a2eba454004f 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -65,6 +65,12 @@ static inline const char *str_read_write(bool v)
 }
 #define str_write_read(v)		str_read_write(!(v))
 
+static inline const char *str_supported_unsupported(bool v)
+{
+	return v ? "supported" : "unsupported";
+}
+#define str_unsupported_supported(v)	str_supported_unsupported(!(v))
+
 static inline const char *str_true_false(bool v)
 {
 	return v ? "true" : "false";

  reply	other threads:[~2026-09-07  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  8:43 [PATCH v2 0/2] Add and use supported/unsupported string helper Thorsten Blum
2026-09-07  8:43 ` Thorsten Blum [this message]
2026-09-07 10:31   ` [PATCH v2 1/2] lib/string_choices: Add str_supported_unsupported() helper Andy Shevchenko
2026-09-07 11:12   ` Thorsten Blum
2026-09-07  8:43 ` [PATCH v2 2/2] platform/x86: thinkpad_acpi: Use " Thorsten Blum
2026-09-07 10:33   ` Andy Shevchenko
2026-09-07 10:31 ` [PATCH v2 0/2] Add and use supported/unsupported string helper Andy Shevchenko

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=20260907084319.351688-5-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=andy@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=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®