block: remove a dead check in show_partition
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Nov 2021 13:06:15 +0000 (14:06 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 29 Nov 2021 13:35:21 +0000 (06:35 -0700)
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>
Link: https://lore.kernel.org/r/20211122130625.1136848-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c

index 30362aeacac4b88b4fa18a841130a046b7f7f105..1c326d3b54b448d91640c1cff5c789199b128155 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;