diff mbox series

[03/10] lib/string_choices: Add str_in_out() helper

Message ID 87tt8h6zew.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:35 a.m. UTC
Add str_in_out() helper to return "in" or "out" 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 2a6c8df585ea..96b54874dc3a 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -83,6 +83,12 @@  static inline const char *str_tx_rx(bool v)
 }
 #define str_rx_tx(v)		str_tx_rx(!(v))
 
+static inline const char *str_in_out(bool v)
+{
+	return v ? "in" : "out";
+}
+#define str_out_in(v)		str_in_out(!(v))
+
 /**
  * str_plural - Return the simple pluralization based on English counts
  * @num: Number used for deciding pluralization