[PATCH v1] mmc: Convert ternary operator to str_write_read() helper
From: Li Dong
Date: Thu Jun 19 2025 - 23:31:00 EST
Replace direct ternary condition check with existing helper function
str_write_read() to improve code readability and maintain consistency.
Signed-off-by: Li Dong <lidong@xxxxxxxx>
---
drivers/mmc/host/mmc_spi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 47443fb5eb33..0a1098140dc0 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -27,6 +27,7 @@
#include <linux/spi/mmc_spi.h>
#include <linux/unaligned.h>
+#include <linux/string_choices.h>
/* NOTES:
@@ -774,7 +775,7 @@ mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd,
unsigned n_sg;
bool multiple = (data->blocks > 1);
bool write = (data->flags & MMC_DATA_WRITE);
- const char *write_or_read = write ? "write" : "read";
+ const char *write_or_read = str_write_read(write);
u32 clock_rate;
unsigned long timeout;
--
2.34.1