diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-03 07:41:04 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-25 08:18:58 -0600 |
commit | 700cd59db518edc2028df7c830d6cb6f7164573b (patch) | |
tree | 2f22b6fc6ba93e36e4977dc10b7689544fa3f356 /lib/vsprintf.c | |
parent | 8a63a86e1f933dc7f114497408c50c58a633b8bc (diff) | |
download | lwn-700cd59db518edc2028df7c830d6cb6f7164573b.tar.gz lwn-700cd59db518edc2028df7c830d6cb6f7164573b.zip |
vsprintf: use bd_partno in bdev_name
No need to go through the hd_struct to find the partition number.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index afb9521ddf91..14c9a6af1b23 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -940,13 +940,13 @@ char *bdev_name(char *buf, char *end, struct block_device *bdev, hd = bdev->bd_disk; buf = string(buf, end, hd->disk_name, spec); - if (bdev->bd_part->partno) { + if (bdev->bd_partno) { if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) { if (buf < end) *buf = 'p'; buf++; } - buf = number(buf, end, bdev->bd_part->partno, spec); + buf = number(buf, end, bdev->bd_partno, spec); } return buf; } |