[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o6yhpmpc.wl-kuninori.morimoto.gx@renesas.com>
Date: Tue, 4 Mar 2025 02:13:35 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Andy Shevchenko <andy@...nel.org>, Kees Cook <kees@...nel.org>,
<linux-hardening@...r.kernel.org>, Andy Shevchenko <andy@...nel.org>, Kees
Cook <kees@...nel.org>, <linux-hardening@...r.kernel.org>
Subject: [PATCH v2 05/10] lib/string_choices: Add str_Y_N() helper
Add str_Y_N() helper to return "Y" or "N" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index cc7c771f4e84..615ddbde4743 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -65,6 +65,12 @@ static inline const char *str_yes_no(bool v)
}
#define str_no_yes(v) str_yes_no(!(v))
+static inline const char *str_Y_N(bool v)
+{
+ return v ? "Y" : "N";
+}
+#define str_N_Y(v) str_Y_N(!(v))
+
static inline const char *str_up_down(bool v)
{
return v ? "up" : "down";
--
2.43.0
Powered by blists - more mailing lists