Skip to contentSkip to conversation

mmc: mmc_spi: remove unnecessary check in mmc_spi_setup_data_message()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 21, 2025 – Aug 22, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: mmc_spi: remove unnecessary check in mmc_spi_setup_data_message()

An earlier commit changed the outer if statement from
"if (multiple || write) {" to "if (write) {" so now we know that "write" is true and no longer need to check. Delete the unnecessary check.

---
 drivers/mmc/host/mmc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mmc_spi.c +1 -1
index 95a32ff29ee1..42936e248c55 100644
@@ -566,7 +566,7 @@ mmc_spi_setup_data_message(struct mmc_spi_host *host, bool multiple, bool write)
 	if (write) {
 		t = &host->early_status;
 		memset(t, 0, sizeof(*t));
-		t->len = write ? sizeof(scratch->status) : 1;
+		t->len = sizeof(scratch->status);
 		t->tx_buf = host->ones;
 		t->rx_buf = scratch->status;
 		t->cs_change = 1;
Signature · 1 line
2.47.2
#1 lore raw
Quoted 6 lines · Dan Carpenter

An earlier commit changed the outer if statement from
"if (multiple || write) {" to "if (write) {" so now we know that "write" is true and no longer need to check. Delete the unnecessary check.

Applied for next, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/mmc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mmc_spi.c +1 -2
index 95a32ff29ee1..42936e248c55 100644
@@ -566,7 +566,7 @@ mmc_spi_setup_data_message(struct mmc_spi_host *host, bool multiple, bool write)
        if (write) {
                t = &host->early_status;
                memset(t, 0, sizeof(*t));
-               t->len = write ? sizeof(scratch->status) : 1;
+               t->len = sizeof(scratch->status);
                t->tx_buf = host->ones;
                t->rx_buf = scratch->status;
                t->cs_change = 1;
--

2.47.2