From: Thomas Richard <thomas.richard@bootlin.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Kees Cook <kees@kernel.org>, Andy Shevchenko <andy@kernel.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
thomas.petazzoni@bootlin.com, DanieleCleri@aaeon.eu,
GaryWang@aaeon.com.tw, linux-hardening@vger.kernel.org,
Thomas Richard <thomas.richard@bootlin.com>
Subject: [PATCH v9 09/10] lib/string_choices: Add str_input_output() helper
Date: Mon, 11 Aug 2025 15:25:52 +0200 [thread overview]
Message-ID: <20250811-aaeon-up-board-pinctrl-support-v9-9-29f0cbbdfb30@bootlin.com> (raw)
In-Reply-To: <20250811-aaeon-up-board-pinctrl-support-v9-0-29f0cbbdfb30@bootlin.com>
Add str_input_output() helper to return 'input' or 'output' string literal.
Also add the inversed variant str_output_input().
Suggested-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
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 f3ba4f52ff2601f2eb5b974602dd075db2ff5d86..a27c87c954ae0de03cb804fdad6f490f2b003e13 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -41,6 +41,12 @@ static inline const char *str_high_low(bool v)
}
#define str_low_high(v) str_high_low(!(v))
+static inline const char *str_input_output(bool v)
+{
+ return v ? "input" : "output";
+}
+#define str_output_input(v) str_input_output(!(v))
+
static inline const char *str_on_off(bool v)
{
return v ? "on" : "off";
--
2.47.2
next prev parent reply other threads:[~2025-08-11 13:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 13:25 [PATCH v9 00/10] Add pinctrl support for the AAEON UP board FPGA Thomas Richard
2025-08-11 13:25 ` [PATCH v9 01/10] gpiolib: add support to register sparse pin range Thomas Richard
2025-08-11 13:25 ` [PATCH v9 02/10] gpio: aggregator: move GPIO forwarder allocation in a dedicated function Thomas Richard
2025-08-11 13:25 ` [PATCH v9 03/10] gpio: aggregator: refactor the code to add GPIO desc in the forwarder Thomas Richard
2025-08-11 13:25 ` [PATCH v9 04/10] gpio: aggregator: refactor the forwarder registration part Thomas Richard
2025-08-11 13:25 ` [PATCH v9 05/10] gpio: aggregator: update gpiochip_fwd_setup_delay_line() parameters Thomas Richard
2025-08-11 13:25 ` [PATCH v9 06/10] gpio: aggregator: export symbols of the GPIO forwarder library Thomas Richard
2025-08-11 13:25 ` [PATCH v9 07/10] gpio: aggregator: handle runtime registration of gpio_desc in gpiochip_fwd Thomas Richard
2025-08-11 13:25 ` [PATCH v9 08/10] gpio: aggregator: add possibility to attach data to the forwarder Thomas Richard
2025-08-11 13:25 ` Thomas Richard [this message]
2025-08-11 13:25 ` [PATCH v9 10/10] pinctrl: Add pin controller driver for AAEON UP boards Thomas Richard
2025-08-18 15:45 ` Linus Walleij
2025-08-11 13:48 ` (subset) [PATCH v9 00/10] Add pinctrl support for the AAEON UP board FPGA Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250811-aaeon-up-board-pinctrl-support-v9-9-29f0cbbdfb30@bootlin.com \
--to=thomas.richard@bootlin.com \
--cc=DanieleCleri@aaeon.eu \
--cc=GaryWang@aaeon.com.tw \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=geert+renesas@glider.be \
--cc=kees@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®