Commit a98ae7f0 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Kees Cook

lib/string_choices: Add str_up_down() helper

Add str_up_down() helper to return "up" or "down" string literal.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://lore.kernel.org/r/20240725101841.574-1-michal.wajdeczko@intel.comSigned-off-by: default avatarKees Cook <kees@kernel.org>
parent 9c6b7fbb
...@@ -42,6 +42,11 @@ static inline const char *str_yes_no(bool v) ...@@ -42,6 +42,11 @@ static inline const char *str_yes_no(bool v)
return v ? "yes" : "no"; 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 * str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization * @num: Number used for deciding pluralization
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment