diff mbox series

[05/10] lib/string_choices: Add str_Y_N() helper

Message ID 87r03l6zeh.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State Superseded
Headers show
Series lib/string_choices: Add new helpers | expand

Commit Message

Kuninori Morimoto Feb. 26, 2025, 5:36 a.m. UTC
Add str_Y_N() helper to return "Y" or "N" string literal.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/linux/string_choices.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

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";