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-next>] [day] [month] [year] [list]
Message-Id: <20240725101841.574-1-michal.wajdeczko@intel.com>
Date: Thu, 25 Jul 2024 12:18:40 +0200
From: Michal Wajdeczko <michal.wajdeczko@...el.com>
To: linux-hardening@...r.kernel.org
Cc: Michal Wajdeczko <michal.wajdeczko@...el.com>,
	Kees Cook <keescook@...omium.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH 1/2] lib/string_choices: Add str_up_down() helper

Add str_up_down() helper to return "up" or "down" string literal.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@...el.com>
---
Cc: Kees Cook <keescook@...omium.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 include/linux/string_choices.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index d9ebe20229f8..bcde3c9cff81 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -42,6 +42,11 @@ static inline const char *str_yes_no(bool v)
 	return v ? "yes" : "no";
 }
 
+static inline const char *str_up_down(bool v)
+{
+	return v ? "up" : "down";
+}
+
 /**
  * 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