Commit 1d703547 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: simplify disk name formatting in check_partition

disk_name for partition 0 just copies out the disk_name field.  Replace
the call to disk_name with a %s format specifier.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20210727062518.122108-6-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 453b8ab6
...@@ -136,7 +136,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd) ...@@ -136,7 +136,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd)
state->pp_buf[0] = '\0'; state->pp_buf[0] = '\0';
state->bdev = hd->part0; state->bdev = hd->part0;
disk_name(hd, 0, state->name); snprintf(state->name, BDEVNAME_SIZE, "%s", hd->disk_name);
snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name); snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name);
if (isdigit(state->name[strlen(state->name)-1])) if (isdigit(state->name[strlen(state->name)-1]))
sprintf(state->name, "p"); sprintf(state->name, "p");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment