[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240812182939.work.424-kees@kernel.org>
Date: Mon, 12 Aug 2024 11:29:40 -0700
From: Kees Cook <kees@...nel.org>
To: Andy Shevchenko <andy@...nel.org>
Cc: Kees Cook <kees@...nel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Michal Wajdeczko <michal.wajdeczko@...el.com>,
linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] string_choices: Add wrapper for str_down_up()
The string choice functions which are not clearly true/false synonyms
also have inverted wrappers. Add this for str_down_up() as well.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Kees Cook <kees@...nel.org>
---
Cc: Andy Shevchenko <andy@...nel.org>
Cc: Michal Wajdeczko <michal.wajdeczko@...el.com>
Cc: linux-hardening@...r.kernel.org
---
include/linux/string_choices.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index bcde3c9cff81..1320bcdcb89c 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -46,6 +46,7 @@ static inline const char *str_up_down(bool v)
{
return v ? "up" : "down";
}
+#define str_down_up(v) str_up_down(!(v))
/**
* str_plural - Return the simple pluralization based on English counts
--
2.34.1
Powered by blists - more mailing lists