lib/string_helpers: Add str_read_write() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 22 Aug 2022 17:49:23 +0000 (17:49 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Aug 2022 16:00:30 +0000 (17:00 +0100)
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>
include/linux/string_helpers.h

index 4d72258..9e22cd7 100644 (file)
@@ -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