[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tt89pmq6.wl-kuninori.morimoto.gx@renesas.com>
Date: Tue, 4 Mar 2025 02:13:05 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Andy Shevchenko <andy@...nel.org>, Kees Cook <kees@...nel.org>,
<linux-hardening@...r.kernel.org>, Andy Shevchenko <andy@...nel.org>, Kees
Cook <kees@...nel.org>, <linux-hardening@...r.kernel.org>
Subject: [PATCH v2 01/10] lib/string_choices: Add str_tx_rx() helper
Add str_tx_rx() helper to return "tx" or "rx" 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 120ca0f28e95..fbbf1e657806 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -71,6 +71,12 @@ static inline const char *str_true_false(bool v)
}
#define str_false_true(v) str_true_false(!(v))
+static inline const char *str_tx_rx(bool v)
+{
+ return v ? "tx" : "rx";
+}
+#define str_rx_tx(v) str_tx_rx(!(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