Re: [PATCH v8 4/4] scsi: ufs: Prepare HPB read for cached sub-region
From: Bart Van Assche
Date: Sat Aug 08 2020 - 20:37:27 EST
On 2020-08-06 02:18, Daejun Park wrote:
> +static inline u32 ufshpb_get_lpn(struct scsi_cmnd *cmnd)
> +{
> + return blk_rq_pos(cmnd->request) >>
> + (ilog2(cmnd->device->sector_size) - 9);
> +}
Please use sectors_to_logical() from drivers/scsi/sd.h instead of open-coding
that function.
> +static inline unsigned int ufshpb_get_len(struct scsi_cmnd *cmnd)
> +{
> + return blk_rq_sectors(cmnd->request) >>
> + (ilog2(cmnd->device->sector_size) - 9);
> +}
Same comment here.
> +/* routine : READ10 -> HPB_READ */
Please expand this comment.
Thanks,
Bart.