[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tt8h6zew.wl-kuninori.morimoto.gx@renesas.com>
Date: Wed, 26 Feb 2025 05:35:51 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Kees Cook <kees@...nel.org>, <linux-hardening@...r.kernel.org>, Kees Cook
<kees@...nel.org>, <linux-hardening@...r.kernel.org>
Subject: [PATCH 03/10] lib/string_choices: Add str_in_out() helper
Add str_in_out() helper to return "in" or "out" 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 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
Powered by blists - more mailing lists