aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2021-07-27 08:25:17 +0200
committerJens Axboe <[email protected]>2021-08-02 13:37:28 -0600
commit1d7035478f64c040441c9cb2aa32e0d7fae526d2 (patch)
tree24444a63eea97b89b8a15abfa1746a66f27e9a9c
parent453b8ab696b32cfd8bad80a5501937440d1cf214 (diff)
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: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/partitions/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2415bffc2771..fb3a556cacce 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -136,7 +136,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd)
state->pp_buf[0] = '\0';
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);
if (isdigit(state->name[strlen(state->name)-1]))
sprintf(state->name, "p");