All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/string_choices: Add str_up_down() helper
@ 2024-07-25 10:18 Michal Wajdeczko
  2024-07-25 10:18 ` [PATCH 2/2] coccinelle: Add rules to find str_up_down() replacements Michal Wajdeczko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michal Wajdeczko @ 2024-07-25 10:18 UTC (permalink / raw)
  To: linux-hardening; +Cc: Michal Wajdeczko, Kees Cook, Andy Shevchenko

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

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
Cc: Kees Cook <keescook@chromium.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-08 17:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 10:18 [PATCH 1/2] lib/string_choices: Add str_up_down() helper Michal Wajdeczko
2024-07-25 10:18 ` [PATCH 2/2] coccinelle: Add rules to find str_up_down() replacements Michal Wajdeczko
2024-08-08  9:11   ` Andy Shevchenko
2024-08-06  4:40 ` [PATCH 1/2] lib/string_choices: Add str_up_down() helper Kees Cook
2024-08-08  9:10 ` Andy Shevchenko
2024-08-08 17:57   ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.