[PATCH 04/14] block: remove a dead check in show_partition

From
Christoph Hellwig <hch@lst.de>
Date
2021-11-22 13:06:42
Also in
linux-mmc, linux-scsi
Reply to
Christoph Hellwig, 2021-11-22
disk_max_parts never returns 0 given that ->minors for devices not using
the extended dev_t must be non-zero, and disk_max_parts always returns
DISK_MAX_PARTS for the latter.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/genhd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index c5392cc24d37e..b1c0f62505bf0 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -814,9 +814,7 @@ static int show_partition(struct seq_file *seqf, void *v)
 	struct block_device *part;
 	unsigned long idx;
 
-	/* Don't show non-partitionable removeable devices or empty devices */
-	if (!get_capacity(sgp) || (!disk_max_parts(sgp) &&
-				   (sgp->flags & GENHD_FL_REMOVABLE)))
+	if (!get_capacity(sgp))
 		return 0;
 	if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
 		return 0;
-- 
2.30.2
Thread (23 messages) 23 messages, 4 authors, last reply 2022-05-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help