diff mbox series

[v2,1/2] lib/string_helpers: Add str_read_write() helper

Message ID 20220703154232.55549-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Mainlined
Commit 1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3
Delegated to: Geert Uytterhoeven
Headers show
Series [v2,1/2] lib/string_helpers: Add str_read_write() helper | expand

Commit Message

Andy Shevchenko July 3, 2022, 3:42 p.m. UTC
Add str_read_write() helper to retun 'read' or 'write' string literal.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: no changes
 include/linux/string_helpers.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 4d72258d42fd..9e22cd78f3b8 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -126,4 +126,9 @@  static inline const char *str_enabled_disabled(bool v)
 	return v ? "enabled" : "disabled";
 }
 
+static inline const char *str_read_write(bool v)
+{
+	return v ? "read" : "write";
+}
+
 #endif