Commit c151eddb authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Martin K. Petersen

scsi: target: iblock: Fix type of logs_per_phys

According to ilog2() it expects 32/64 bit unsigned value.

"  147  * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value"

Replace type of logs_per_phys from int to unsigned int.

Link: https://lore.kernel.org/r/20210228055645.22253-4-chaitanya.kulkarni@wdc.comReviewed-by: default avatarMike Christie <michael.christie@oracle.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a2c6c6a3
......@@ -853,7 +853,7 @@ static unsigned int iblock_get_lbppbe(struct se_device *dev)
{
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
struct block_device *bd = ib_dev->ibd_bd;
int logs_per_phys =
unsigned int logs_per_phys =
bdev_physical_block_size(bd) / bdev_logical_block_size(bd);
return ilog2(logs_per_phys);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment