]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: stop using bdevname in __blkdev_issue_discard
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Jul 2022 05:53:10 +0000 (07:53 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 16:27:56 +0000 (10:27 -0600)
Just use the %pg format specifier instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220713055317.1888500-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-lib.c

index 09b7e1200c0f40fb0d539ba889db9b8aa553b668..67e6dbc1ae8179594a57e89e87d6d247af358940 100644 (file)
@@ -48,10 +48,8 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 
        /* In case the discard granularity isn't set by buggy device driver */
        if (WARN_ON_ONCE(!bdev_discard_granularity(bdev))) {
-               char dev_name[BDEVNAME_SIZE];
-
-               bdevname(bdev, dev_name);
-               pr_err_ratelimited("%s: Error: discard_granularity is 0.\n", dev_name);
+               pr_err_ratelimited("%pg: Error: discard_granularity is 0.\n",
+                                  bdev);
                return -EOPNOTSUPP;
        }