Re: [PATCH] scsi: fix the return value of scsi_logical_block_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chaotian,

> @@ -236,7 +236,7 @@ static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd)
>  {
>  	unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT;
>  
> -	return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift;
> +	return blk_rq_sectors(scsi_cmd_to_rq(scmd)) >> shift;
>  }

There's no point in shifting twice by converting to sectors first.
Please just remove the SECTOR_SHIFT subtraction.

-- 
Martin K. Petersen	Oracle Linux Engineering




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux