[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jz9d6zdu.wl-kuninori.morimoto.gx@renesas.com>
Date: Wed, 26 Feb 2025 05:36:29 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Kees Cook <kees@...nel.org>, linux-hardening@...r.kernel.org
Subject: [PATCH 10/10] lib/string_choices: Add str_attach_detach() helper
Add str_attach_detach() helper to return "attach" or "detach" string
literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
---
include/linux/string_choices.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 82c5927d50a9..12b26cb5ca6f 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -125,6 +125,13 @@ static inline const char *str_kernel_user(bool v)
}
#define str_user_kernel(v) str_kernel_user(!(v))
+static inline const char *str_attach_detach(bool v)
+{
+ return v ? "attach" : "detach";
+}
+#define str_attach_detach(v) str_attach_detach(!(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