[PATCH v1 2/3] lib/string_helpers: Add str_high_low() helper
From: Andy Shevchenko
Date: Wed Nov 30 2022 - 06:50:24 EST
Add str_high_low() helper to return 'high' or 'low' string literal.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
include/linux/string_helpers.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 8530c7328269..fd72393e7975 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -128,6 +128,11 @@ static inline const char *str_enabled_disabled(bool v)
return v ? "enabled" : "disabled";
}
+static inline const char *str_high_low(bool v)
+{
+ return v ? "high" : "low";
+}
+
static inline const char *str_read_write(bool v)
{
return v ? "read" : "write";
--
2.35.1