summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorThorsten Blum <blum@kernel.org>2026-09-07 10:43:20 +0200
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-10-13 11:44:50 +0300
commitccd5ff410feb2adcf3840d071cf796cc5c549520 (patch)
treeb04858b52debe609638c9d9a4e5aab86b658e20f /include/linux
parent4981fb7fe9eb1af526236384e8e0505d8c18928e (diff)
downloadlinux-ccd5ff410feb2adcf3840d071cf796cc5c549520.tar.gz
linux-ccd5ff410feb2adcf3840d071cf796cc5c549520.zip
lib/string_choices: Add str_supported_unsupported() helper
Add str_supported_unsupported() to return "supported" or "unsupported" depending on the boolean argument. Also add the inverse str_unsupported_supported(). Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Thorsten Blum <blum@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20260907084319.351688-5-blum@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/string_choices.h6
1 files changed, 6 insertions, 0 deletions
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";