block: remove a dead check in show_partition
authorChristoph Hellwig <hch@lst.de>
Thu, 2 Sep 2021 09:20:26 +0000 (11:20 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 22 Nov 2021 13:05:13 +0000 (14:05 +0100)
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

index c5392cc24d37ef32fbeac5b78b18f35d920d8cef..b1c0f62505bf0cd347e44c013023fe138e3aec96 100644 (file)
@@ -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;