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: <20250429-aaeon-up-board-pinctrl-support-v4-11-b3fffc11417d@bootlin.com>
Date: Tue, 29 Apr 2025 16:08:25 +0200
From: Thomas Richard <thomas.richard@...tlin.com>
To: Linus Walleij <linus.walleij@...aro.org>, 
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
 Bartosz Golaszewski <brgl@...ev.pl>, 
 Geert Uytterhoeven <geert+renesas@...der.be>, Kees Cook <kees@...nel.org>, 
 Andy Shevchenko <andy@...nel.org>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org, 
 thomas.petazzoni@...tlin.com, DanieleCleri@...on.eu, GaryWang@...on.com.tw, 
 linux-hardening@...r.kernel.org, 
 Thomas Richard <thomas.richard@...tlin.com>
Subject: [PATCH v4 11/12] lib/string_choices: Add str_input_output() helper

Add str_input_output() helper to return 'input' or 'output' string literal.
Also add the inversed variant str_output_input().

Signed-off-by: Thomas Richard <thomas.richard@...tlin.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 f3ba4f52ff26..ca2f37fa1b84 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -41,6 +41,12 @@ static inline const char *str_high_low(bool v)
 }
 #define str_low_high(v)		str_high_low(!(v))
 
+static inline const char *str_input_output(bool v)
+{
+	return v ? "input" : "output";
+}
+#define str_output_input	str_input_output(!(v))
+
 static inline const char *str_on_off(bool v)
 {
 	return v ? "on" : "off";

-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ