From 3f9b8fb46e5d20eac314f56747e24e1a4e74539d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 12 Apr 2024 00:54:19 -0400 Subject: Use bdev_is_paritition() instead of open-coding it Reviewed-by: Christoph Hellwig Signed-off-by: Al Viro --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 552738f14275..3f9f1b959ef0 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -966,7 +966,7 @@ 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_partno) { + if (bdev_is_partition(bdev)) { if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) { if (buf < end) *buf = 'p'; -- cgit v1.2.3 From b8c873edbf35570b93edfeddad9e85da54defa52 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 12 Apr 2024 01:01:36 -0400 Subject: wrapper for access to ->bd_partno On the next step it's going to get folded into a field where flags will go. Signed-off-by: Al Viro --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3f9f1b959ef0..cdd4e2314bfc 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -972,7 +972,7 @@ char *bdev_name(char *buf, char *end, struct block_device *bdev, *buf = 'p'; buf++; } - buf = number(buf, end, bdev->bd_partno, spec); + buf = number(buf, end, bdev_partno(bdev), spec); } return buf; } -- cgit v1.2.3