lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v7sx6zf1.wl-kuninori.morimoto.gx@renesas.com>
Date: Wed, 26 Feb 2025 05:35:46 +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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ