mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
lib/string_choices: Add str_high_low() helper
Add str_high_low() helper to return 'high' or 'low' string literal. Also add an inversed variant, i.e. str_low_high(). All the same for str_hi_low(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
@@ -14,6 +14,18 @@ static inline const char *str_enabled_disabled(bool v)
|
|||||||
return v ? "enabled" : "disabled";
|
return v ? "enabled" : "disabled";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline const char *str_hi_lo(bool v)
|
||||||
|
{
|
||||||
|
return v ? "hi" : "lo";
|
||||||
|
}
|
||||||
|
#define str_lo_hi(v) str_hi_lo(!(v))
|
||||||
|
|
||||||
|
static inline const char *str_high_low(bool v)
|
||||||
|
{
|
||||||
|
return v ? "high" : "low";
|
||||||
|
}
|
||||||
|
#define str_low_high(v) str_high_low(!(v))
|
||||||
|
|
||||||
static inline const char *str_read_write(bool v)
|
static inline const char *str_read_write(bool v)
|
||||||
{
|
{
|
||||||
return v ? "read" : "write";
|
return v ? "read" : "write";
|
||||||
|
Reference in New Issue
Block a user