Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/string_choices: Rearrange functions in sorted order

Rearrange misplaced functions in sorted order.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: R Sundar <prosunofficial@gmail.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://lore.kernel.org/r/20241119021719.7659-2-prosunofficial@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>

authored by

R Sundar and committed by
Kees Cook
b56e601a 1286f632

+12 -12
+12 -12
include/linux/string_choices.h
··· 41 41 } 42 42 #define str_low_high(v) str_high_low(!(v)) 43 43 44 - static inline const char *str_read_write(bool v) 45 - { 46 - return v ? "read" : "write"; 47 - } 48 - #define str_write_read(v) str_read_write(!(v)) 49 - 50 44 static inline const char *str_on_off(bool v) 51 45 { 52 46 return v ? "on" : "off"; 53 47 } 54 48 #define str_off_on(v) str_on_off(!(v)) 55 49 56 - static inline const char *str_yes_no(bool v) 50 + static inline const char *str_read_write(bool v) 57 51 { 58 - return v ? "yes" : "no"; 52 + return v ? "read" : "write"; 59 53 } 60 - #define str_no_yes(v) str_yes_no(!(v)) 54 + #define str_write_read(v) str_read_write(!(v)) 55 + 56 + static inline const char *str_true_false(bool v) 57 + { 58 + return v ? "true" : "false"; 59 + } 60 + #define str_false_true(v) str_true_false(!(v)) 61 61 62 62 static inline const char *str_up_down(bool v) 63 63 { ··· 65 65 } 66 66 #define str_down_up(v) str_up_down(!(v)) 67 67 68 - static inline const char *str_true_false(bool v) 68 + static inline const char *str_yes_no(bool v) 69 69 { 70 - return v ? "true" : "false"; 70 + return v ? "yes" : "no"; 71 71 } 72 - #define str_false_true(v) str_true_false(!(v)) 72 + #define str_no_yes(v) str_yes_no(!(v)) 73 73 74 74 /** 75 75 * str_plural - Return the simple pluralization based on English counts