[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o6yp6ze7.wl-kuninori.morimoto.gx@renesas.com>
Date: Wed, 26 Feb 2025 05:36:16 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Kees Cook <kees@...nel.org>, linux-hardening@...r.kernel.org
Subject: [PATCH 07/10] lib/string_choices: Add str_to_from() helper
Add str_to_from() helper to return "to" or "from" 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 d52ced93e21e..e07a9a5e403e 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -107,6 +107,12 @@ static inline const char *str_pass_fail(bool v)
}
#define str_fail_pass(v) str_pass_fail(!(v))
+static inline const char *str_to_from(bool v)
+{
+ return v ? "to" : "from";
+}
+#define str_from_to(v) str_to_from(!(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