Add str_in_out() helper to return "in" or "out" string literal.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto...@renesas.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 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
-- 
2.43.0


Reply via email to