* [PATCH v1] mmc: Convert ternary operator to str_true_false() helper
@ 2025-06-20 4:35 Li Dong
2025-06-20 5:51 ` Krzysztof Kozlowski
2025-07-03 12:19 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Li Dong @ 2025-06-20 4:35 UTC (permalink / raw)
To: Aubin Constans, Ulf Hansson, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea,
open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
moderated list:ARM/Microchip (AT91) SoC support, open list
Cc: opensource.kernel, rongqianfeng, Li Dong
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@vivo.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] mmc: Convert ternary operator to str_true_false() helper
2025-06-20 4:35 [PATCH v1] mmc: Convert ternary operator to str_true_false() helper Li Dong
@ 2025-06-20 5:51 ` Krzysztof Kozlowski
2025-07-03 12:19 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-20 5:51 UTC (permalink / raw)
To: Li Dong, Aubin Constans, Ulf Hansson, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea,
open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
moderated list:ARM/Microchip (AT91) SoC support, open list
Cc: opensource.kernel, rongqianfeng
On 20/06/2025 06:35, Li Dong 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@vivo.com>
> ---
> drivers/mmc/host/atmel-mci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Why are you sending this line per patch? Not even patchset?
Is it again another run of @vivo.com submissions when you spam community
with low quality things, just because someone told you to run coccinelle?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] mmc: Convert ternary operator to str_true_false() helper
2025-06-20 4:35 [PATCH v1] mmc: Convert ternary operator to str_true_false() helper Li Dong
2025-06-20 5:51 ` Krzysztof Kozlowski
@ 2025-07-03 12:19 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2025-07-03 12:19 UTC (permalink / raw)
To: Li Dong
Cc: Aubin Constans, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
moderated list:ARM/Microchip (AT91) SoC support, open list,
opensource.kernel, rongqianfeng
On Fri, 20 Jun 2025 at 06:35, Li Dong <lidong@vivo.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@vivo.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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-03 12:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 4:35 [PATCH v1] mmc: Convert ternary operator to str_true_false() helper Li Dong
2025-06-20 5:51 ` Krzysztof Kozlowski
2025-07-03 12:19 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).