Skip to contentSkip to conversation

mmc: block: Suppress empty whitespaces in prints

PATCH In review Florian Fainelli 2 participants 2 messages May 9, 2023 – May 24, 2023 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: block: Suppress empty whitespaces in prints

If the device is not read-only, then we will be printing an empty whitespace before the newline, fix that.

---
 drivers/mmc/core/block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/block.c +2 -2
index 00c33edb9fb9..761876e5012a 100644
@@ -2502,9 +2502,9 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 
 	string_get_size((u64)size, 512, STRING_UNITS_2,
 			cap_str, sizeof(cap_str));
-	pr_info("%s: %s %s %s %s\n",
+	pr_info("%s: %s %s %s%s\n",
 		md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
-		cap_str, md->read_only ? "(ro)" : "");
+		cap_str, md->read_only ? " (ro)" : "");
 
 	/* used in ->open, must be set before add_disk: */
 	if (area_type == MMC_BLK_DATA_AREA_MAIN)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Florian Fainelli

If the device is not read-only, then we will be printing an empty whitespace before the newline, fix that.

Applied for next, thanks!

Kind regards
Uffe

Quoted 23 lines
---
 drivers/mmc/core/block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/block.c +2 -3
index 00c33edb9fb9..761876e5012a 100644
@@ -2502,9 +2502,9 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 
        string_get_size((u64)size, 512, STRING_UNITS_2,
                        cap_str, sizeof(cap_str));
-       pr_info("%s: %s %s %s %s\n",
+       pr_info("%s: %s %s %s%s\n",
                md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
-               cap_str, md->read_only ? "(ro)" : "");
+               cap_str, md->read_only ? " (ro)" : "");
 
        /* used in ->open, must be set before add_disk: */
        if (area_type == MMC_BLK_DATA_AREA_MAIN)
--

2.34.1