* [PATCH v1] mmc: Convert ternary operator to str_plural() helper
@ 2025-06-18 11:59 Li Dong
2025-06-19 11:20 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Li Dong @ 2025-06-18 11:59 UTC (permalink / raw)
To: Michał Mirosław, Ulf Hansson,
open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
open list
Cc: opensource.kernel, lidong
Replace direct ternary condition check with existing helper function
str_plural() to improve code readability and maintain consistency.
Signed-off-by: Li Dong <lidong@vivo.com>
---
drivers/mmc/host/cb710-mmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index d741c1f9cf87..52f9cf7dbc7f 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
+#include <linux/string_choices.h>
#include "cb710-mmc.h"
#define CB710_MMC_REQ_TIMEOUT_MS 2000
@@ -215,7 +216,7 @@ static void cb710_mmc_set_transfer_size(struct cb710_slot *slot,
((count - 1) << 16)|(blocksize - 1));
dev_vdbg(cb710_slot_dev(slot), "set up for %zu block%s of %zu bytes\n",
- count, count == 1 ? "" : "s", blocksize);
+ count, str_plural(count), blocksize);
}
static void cb710_mmc_fifo_hack(struct cb710_slot *slot)
--
2.39.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] mmc: Convert ternary operator to str_plural() helper
2025-06-18 11:59 [PATCH v1] mmc: Convert ternary operator to str_plural() helper Li Dong
@ 2025-06-19 11:20 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2025-06-19 11:20 UTC (permalink / raw)
To: Li Dong
Cc: Michał Mirosław,
open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
open list, opensource.kernel
On Wed, 18 Jun 2025 at 14:00, Li Dong <lidong@vivo.com> wrote:
>
> Replace direct ternary condition check with existing helper function
> str_plural() to improve code readability and maintain consistency.
>
> Signed-off-by: Li Dong <lidong@vivo.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/cb710-mmc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> index d741c1f9cf87..52f9cf7dbc7f 100644
> --- a/drivers/mmc/host/cb710-mmc.c
> +++ b/drivers/mmc/host/cb710-mmc.c
> @@ -8,6 +8,7 @@
> #include <linux/module.h>
> #include <linux/pci.h>
> #include <linux/delay.h>
> +#include <linux/string_choices.h>
> #include "cb710-mmc.h"
>
> #define CB710_MMC_REQ_TIMEOUT_MS 2000
> @@ -215,7 +216,7 @@ static void cb710_mmc_set_transfer_size(struct cb710_slot *slot,
> ((count - 1) << 16)|(blocksize - 1));
>
> dev_vdbg(cb710_slot_dev(slot), "set up for %zu block%s of %zu bytes\n",
> - count, count == 1 ? "" : "s", blocksize);
> + count, str_plural(count), blocksize);
> }
>
> static void cb710_mmc_fifo_hack(struct cb710_slot *slot)
> --
> 2.39.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-19 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 11:59 [PATCH v1] mmc: Convert ternary operator to str_plural() helper Li Dong
2025-06-19 11:20 ` 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).