From: Andy Shevchenko Date: Mon, 22 Aug 2022 17:49:23 +0000 (+0000) Subject: lib/string_helpers: Add str_read_write() helper X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1f5d7ea73c4b630dbb2c90818cb9fc0be54d2fe3;p=linux.git 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 Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20220822175011.2886-2-ddrokosov@sberdevices.ru Signed-off-by: Jonathan Cameron --- diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index 4d72258d42fd9..9e22cd78f3b8e 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