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