lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/3] lib/string_helpers: Add str_high_low() helper
Date
Add str_high_low() helper to return 'high' or 'low' string literal.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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
\
 
 \ /
  Last update: 2022-11-30 12:51    [W:0.027 / U:2.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site