Skip to content

Commit e924da7

Browse files
johnpgarryaxboe
authored andcommitted
block: Drop granularity check in queue_limit_discard_alignment()
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent b491255 commit e924da7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

block/blk-settings.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ static unsigned int queue_limit_discard_alignment(
465465
/* Why are these in bytes, not sectors? */
466466
alignment = lim->discard_alignment >> SECTOR_SHIFT;
467467
granularity = lim->discard_granularity >> SECTOR_SHIFT;
468-
if (!granularity)
469-
return 0;
470468

471469
/* Offset of the partition start in 'granularity' sectors */
472470
offset = sector_div(sector, granularity);

0 commit comments

Comments
 (0)