mmc: block: Suppress empty whitespaces in prints
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 9 May 2023 19:44:53 +0000 (12:44 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 12 Jun 2023 13:16:18 +0000 (15:16 +0200)
If the device is not read-only, then we will be printing an empty
whitespace before the newline, fix that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230509194455.1791890-1-f.fainelli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/block.c

index d920c417838930214b7d9c77fc4208d66c177e6e..21fdb4d435432b2bec55b80f78f08a2bbd1f292a 100644 (file)
@@ -2505,9 +2505,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)