[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mse1pmp7.wl-kuninori.morimoto.gx@renesas.com>
Date: Tue, 4 Mar 2025 02:13:40 +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 06/10] lib/string_choices: Add str_pass_fail() helper
Add str_pass_fail() helper to return "pass" or "fail" 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 615ddbde4743..d52ced93e21e 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -101,6 +101,12 @@ static inline const char *str_input_output(bool v)
}
#define str_output_input(v) str_input_output(!(v))
+static inline const char *str_pass_fail(bool v)
+{
+ return v ? "pass" : "fail";
+}
+#define str_fail_pass(v) str_pass_fail(!(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