summaryrefslogtreecommitdiffstats
path: root/include/linux/string_helpers.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-08-22 17:49:23 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-08-28 17:00:30 +0100
commit1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3 (patch)
tree362fc552ee7c3762f13ae23f1b2313074fe3bb35 /include/linux/string_helpers.h
parentc05c3e5d4e563ac84624c093addee644194984eb (diff)
downloadlinux-1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3.tar.gz
linux-1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3.tar.bz2
linux-1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3.zip
lib/string_helpers: Add str_read_write() helper
Add str_read_write() helper to return 'read' or 'write' string literal. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Link: https://lore.kernel.org/r/20220822175011.2886-2-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/string_helpers.h')
-rw-r--r--include/linux/string_helpers.h5
1 files changed, 5 insertions, 0 deletions
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