Skip to content

Commit a98ae7f

Browse files
mwajdeczkees
authored andcommitted
lib/string_choices: Add str_up_down() helper
Add str_up_down() helper to return "up" or "down" string literal. Signed-off-by: Michal Wajdeczko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 9c6b7fb commit a98ae7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/string_choices.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ static inline const char *str_yes_no(bool v)
4242
return v ? "yes" : "no";
4343
}
4444

45+
static inline const char *str_up_down(bool v)
46+
{
47+
return v ? "up" : "down";
48+
}
49+
4550
/**
4651
* str_plural - Return the simple pluralization based on English counts
4752
* @num: Number used for deciding pluralization

0 commit comments

Comments
 (0)