lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFp+w5UvpGKPtehqUrZHsAJ+tivLKtBcn8vJgOm1ZxWJrQ@mail.gmail.com>
Date: Thu, 3 Jul 2025 14:19:15 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Li Dong <lidong@...o.com>
Cc: Aubin Constans <aubin.constans@...rochip.com>, 
	Nicolas Ferre <nicolas.ferre@...rochip.com>, 
	Alexandre Belloni <alexandre.belloni@...tlin.com>, Claudiu Beznea <claudiu.beznea@...on.dev>, 
	"open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND..." <linux-mmc@...r.kernel.org>, 
	"moderated list:ARM/Microchip (AT91) SoC support" <linux-arm-kernel@...ts.infradead.org>, 
	open list <linux-kernel@...r.kernel.org>, opensource.kernel@...o.com, 
	rongqianfeng@...o.com
Subject: Re: [PATCH v1] mmc: Convert ternary operator to str_true_false() helper

On Fri, 20 Jun 2025 at 06:35, Li Dong <lidong@...o.com> wrote:
>
> Replace direct ternary condition check with existing helper function
> str_true_false() to improve code readability and maintain consistency.
>
> Signed-off-by: Li Dong <lidong@...o.com>

Applied for next, thanks!

Note that I am applying this since $subject patch takes care of *all*
possible conversions (it just happens to one in this case) to
str_true_false() for the mmc subsystem.

Kind regards
Uffe


> ---
>  drivers/mmc/host/atmel-mci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 0e0666c0bb6e..1f11626c8f47 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -38,6 +38,7 @@
>  #include <asm/cacheflush.h>
>  #include <asm/io.h>
>  #include <linux/unaligned.h>
> +#include <linux/string_choices.h>
>
>  #define ATMCI_MAX_NR_SLOTS     2
>
> @@ -2264,7 +2265,7 @@ static int atmci_init_slot(struct atmel_mci *host,
>                 "slot[%u]: bus_width=%u, detect_pin=%d, "
>                 "detect_is_active_high=%s, wp_pin=%d\n",
>                 id, slot_data->bus_width, desc_to_gpio(slot_data->detect_pin),
> -               !gpiod_is_active_low(slot_data->detect_pin) ? "true" : "false",
> +               str_true_false(!gpiod_is_active_low(slot_data->detect_pin)),
>                 desc_to_gpio(slot_data->wp_pin));
>
>         mmc->ops = &atmci_ops;
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ