diff options
Diffstat (limited to 'include/linux/string_choices.h')
| -rw-r--r-- | include/linux/string_choices.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index 120ca0f28e95..ee84087d4b26 100644 --- a/include/linux/string_choices.h +++ b/include/linux/string_choices.h @@ -17,6 +17,12 @@ #include <linux/types.h> +static inline const char *str_assert_deassert(bool v) +{ + return v ? "assert" : "deassert"; +} +#define str_deassert_assert(v) str_assert_deassert(!(v)) + static inline const char *str_enable_disable(bool v) { return v ? "enable" : "disable"; @@ -41,11 +47,11 @@ static inline const char *str_high_low(bool v) } #define str_low_high(v) str_high_low(!(v)) -static inline const char *str_read_write(bool v) +static inline const char *str_input_output(bool v) { - return v ? "read" : "write"; + return v ? "input" : "output"; } -#define str_write_read(v) str_read_write(!(v)) +#define str_output_input(v) str_input_output(!(v)) static inline const char *str_on_off(bool v) { @@ -53,11 +59,17 @@ static inline const char *str_on_off(bool v) } #define str_off_on(v) str_on_off(!(v)) -static inline const char *str_yes_no(bool v) +static inline const char *str_read_write(bool v) { - return v ? "yes" : "no"; + return v ? "read" : "write"; } -#define str_no_yes(v) str_yes_no(!(v)) +#define str_write_read(v) str_read_write(!(v)) + +static inline const char *str_true_false(bool v) +{ + return v ? "true" : "false"; +} +#define str_false_true(v) str_true_false(!(v)) static inline const char *str_up_down(bool v) { @@ -65,11 +77,11 @@ static inline const char *str_up_down(bool v) } #define str_down_up(v) str_up_down(!(v)) -static inline const char *str_true_false(bool v) +static inline const char *str_yes_no(bool v) { - return v ? "true" : "false"; + return v ? "yes" : "no"; } -#define str_false_true(v) str_true_false(!(v)) +#define str_no_yes(v) str_yes_no(!(v)) /** * str_plural - Return the simple pluralization based on English counts |
