[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c48d6cda-8508-46f9-92b9-6621b335b565@gmail.com>
Date: Tue, 14 Jan 2025 15:19:11 -0800
From: Doug Berger <opendmb@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski
<brgl@...ev.pl>, Andy Shevchenko <andy@...nel.org>,
Uwe Kleine-König <ukleinek@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
Nandor Han <nandor.han@...com>, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
patches@...nsource.cirrus.com
Subject: Re: [PATCH v2] gpio: Use str_enable_disable-like helpers
On 1/14/2025 11:14 AM, Krzysztof Kozlowski wrote:
> Replace ternary (condition ? "enable" : "disable") syntax with helpers
> from string_choices.h because:
> 1. Simple function call with one argument is easier to read. Ternary
> operator has three arguments and with wrapping might lead to quite
> long code.
> 2. Is slightly shorter thus also easier to read.
> 3. It brings uniformity in the text - same string.
> 4. Allows deduping by the linker, which results in a smaller binary
> file.
>
> Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
>
> Changes in v2:
> 1. Many more files changed.
> ---
> drivers/gpio/gpio-brcmstb.c | 3 ++-
> drivers/gpio/gpio-crystalcove.c | 3 ++-
> drivers/gpio/gpio-grgpio.c | 3 ++-
> drivers/gpio/gpio-mvebu.c | 7 ++++---
> drivers/gpio/gpio-nomadik.c | 3 ++-
> drivers/gpio/gpio-stmpe.c | 6 +++---
> drivers/gpio/gpio-wcove.c | 3 ++-
> drivers/gpio/gpio-wm831x.c | 3 ++-
> drivers/gpio/gpio-xra1403.c | 3 ++-
> drivers/gpio/gpiolib.c | 3 ++-
> 10 files changed, 23 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
> index 491b529d25f8..ca3472977431 100644
> --- a/drivers/gpio/gpio-brcmstb.c
> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -9,6 +9,7 @@
> #include <linux/irqchip/chained_irq.h>
> #include <linux/interrupt.h>
> #include <linux/platform_device.h>
> +#include <linux/string_choices.h>
>
> enum gio_reg_index {
> GIO_REG_ODEN = 0,
> @@ -224,7 +225,7 @@ static int brcmstb_gpio_priv_set_wake(struct brcmstb_gpio_priv *priv,
> ret = disable_irq_wake(priv->parent_wake_irq);
> if (ret)
> dev_err(&priv->pdev->dev, "failed to %s wake-up interrupt\n",
> - enable ? "enable" : "disable");
> + str_enable_disable(enable));
> return ret;
> }
>
For gpio-brcmstb:
Acked-by: Doug Berger <opendmb@...il.com>
Powered by blists - more mailing lists