diff mbox series

[2/5] block: stop using bdevname in __blkdev_issue_discard

Message ID 20220303113223.326220-3-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/5] block: stop using bdevname in bdev_write_inode | expand

Commit Message

Christoph Hellwig March 3, 2022, 11:32 a.m. UTC
Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-lib.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Johannes Thumshirn March 3, 2022, 3:34 p.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/block/blk-lib.c b/block/blk-lib.c
index fc6ea52e74824..a745fc389a7c5 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -34,10 +34,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(!q->limits.discard_granularity)) {
-		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;
 	}