From 84ff1bcc2e25f1ddf5b350c4fa718ca01fdd88e9 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Wed, 26 Apr 2017 18:39:47 -0400 Subject: [PATCH] dm integrity: use previously calculated log2 of sectors_per_block The log2 of sectors_per_block was already calculated, so we don't have to use the ilog2 function. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer --- drivers/md/dm-integrity.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 023d3f8a51cc..c7f7c8d76576 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -2369,7 +2368,7 @@ static void dm_integrity_set(struct dm_target *ti, struct dm_integrity_c *ic) bi.profile = &dm_integrity_profile; bi.tuple_size = ic->tag_size; bi.tag_size = bi.tuple_size; - bi.interval_exp = ilog2(ic->sectors_per_block << SECTOR_SHIFT); + bi.interval_exp = ic->sb->log2_sectors_per_block + SECTOR_SHIFT; blk_integrity_register(disk, &bi); blk_queue_max_integrity_segments(disk->queue, UINT_MAX);