Message ID | 20240813053534.7720-1-chaotian.jing@mediatek.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v2] scsi: fix the return value of scsi_logical_block_count | expand |
On Tue, 13 Aug 2024 13:34:10 +0800, Chaotian Jing wrote: > scsi_logical_block_count() should return the block count of scsi device, > but the original code has a wrong implement. > > Applied to 6.11/scsi-fixes, thanks! [1/1] scsi: fix the return value of scsi_logical_block_count https://git.kernel.org/mkp/scsi/c/f03e94f23b04
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 45c40d200154..8ecfb94049db 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -234,7 +234,7 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd) { - unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; + unsigned int shift = ilog2(scmd->device->sector_size); return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift; }