diff mbox series

[04/10] lib/string_choices: Add str_input_output() helper

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

Commit Message

Kuninori Morimoto Feb. 26, 2025, 5:36 a.m. UTC
Add str_input_output() helper to return "input" or "output" 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 96b54874dc3a..cc7c771f4e84 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -89,6 +89,12 @@  static inline const char *str_in_out(bool v)
 }
 #define str_out_in(v)		str_in_out(!(v))
 
+static inline const char *str_input_output(bool v)
+{
+	return v ? "input" : "output";
+}
+#define str_output_input(v)	str_input_output(!(v))
+
 /**
  * str_plural - Return the simple pluralization based on English counts
  * @num: Number used for deciding pluralization