[PATCH v14 13/14] lib/string_choices: add str_rising_falling()

From: Long Zhao via B4 Relay

Date: Mon Nov 09 2026 - 23:40:01 EST


From: Long Zhao <longzhao@xxxxxxxxxxxxx>

Add str_rising_falling() and str_falling_rising() for code that
prints an IRQ trigger edge.

Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Signed-off-by: Long Zhao <longzhao@xxxxxxxxxxxxx>

---
Cc: Kees Cook <kees@xxxxxxxxxx>
Cc: linux-hardening@xxxxxxxxxxxxxxx
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index ee84087d4b26..c3a0360334d6 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -65,6 +65,12 @@ static inline const char *str_read_write(bool v)
}
#define str_write_read(v) str_read_write(!(v))

+static inline const char *str_rising_falling(bool v)
+{
+ return v ? "rising" : "falling";
+}
+#define str_falling_rising(v) str_rising_falling(!(v))
+
static inline const char *str_true_false(bool v)
{
return v ? "true" : "false";

--
2.34.1