lim->discard_granularity is always at least SECTOR_SIZE, so drop the pointless check for granularity less than SECTOR_SIZE. Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx> diff --git a/block/blk-settings.c b/block/blk-settings.c index 7d6b296997c2..4091794c5a1c 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -457,8 +457,6 @@ static unsigned int queue_limit_discard_alignment( /* Why are these in bytes, not sectors? */ alignment = lim->discard_alignment >> SECTOR_SHIFT; granularity = lim->discard_granularity >> SECTOR_SHIFT; - if (!granularity) - return 0; /* Offset of the partition start in 'granularity' sectors */ offset = sector_div(sector, granularity); -- 2.31.1