diff mbox series

[v3,4/8] isci: Use scsi_get_sector() instead of scsi_get_lba()

Message ID 20210513223757.3938-5-bvanassche@acm.org
State New
Headers show
Series Rename scsi_get_lba() into scsi_get_sector() | expand

Commit Message

Bart Van Assche May 13, 2021, 10:37 p.m. UTC
Use scsi_get_sector() instead of scsi_get_lba() since the name of the
latter is confusing. Additionally, use lower_32_bits() instead of
open-coding it. This patch does not change any functionality.

Reviewed-by: Lee Duncan <lduncan@suse.com>
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/isci/request.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Damien Le Moal May 14, 2021, 1:58 a.m. UTC | #1
On 2021/05/14 7:38, Bart Van Assche wrote:
> Use scsi_get_sector() instead of scsi_get_lba() since the name of the
> latter is confusing. Additionally, use lower_32_bits() instead of
> open-coding it. This patch does not change any functionality.
> 
> Reviewed-by: Lee Duncan <lduncan@suse.com>
> Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/isci/request.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
> index e7c6cb4c1556..ad24ddbcaea3 100644
> --- a/drivers/scsi/isci/request.c
> +++ b/drivers/scsi/isci/request.c
> @@ -341,7 +341,7 @@ static void scu_ssp_ireq_dif_insert(struct isci_request *ireq, u8 type, u8 op)
>  	tc->reserved_E8_0 = 0;
>  
>  	if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2))
> -		tc->ref_tag_seed_gen = scsi_get_lba(scmd) & 0xffffffff;
> +		tc->ref_tag_seed_gen = lower_32_bits(scsi_get_sector(scmd));
>  	else if (type & SCSI_PROT_DIF_TYPE3)
>  		tc->ref_tag_seed_gen = 0;
>  }
> @@ -369,7 +369,7 @@ static void scu_ssp_ireq_dif_strip(struct isci_request *ireq, u8 type, u8 op)
>  	tc->app_tag_gen = 0;
>  
>  	if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2))
> -		tc->ref_tag_seed_verify = scsi_get_lba(scmd) & 0xffffffff;
> +		tc->ref_tag_seed_verify = lower_32_bits(scsi_get_sector(scmd));
>  	else if (type & SCSI_PROT_DIF_TYPE3)
>  		tc->ref_tag_seed_verify = 0;
>  
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
diff mbox series

Patch

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index e7c6cb4c1556..ad24ddbcaea3 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -341,7 +341,7 @@  static void scu_ssp_ireq_dif_insert(struct isci_request *ireq, u8 type, u8 op)
 	tc->reserved_E8_0 = 0;
 
 	if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2))
-		tc->ref_tag_seed_gen = scsi_get_lba(scmd) & 0xffffffff;
+		tc->ref_tag_seed_gen = lower_32_bits(scsi_get_sector(scmd));
 	else if (type & SCSI_PROT_DIF_TYPE3)
 		tc->ref_tag_seed_gen = 0;
 }
@@ -369,7 +369,7 @@  static void scu_ssp_ireq_dif_strip(struct isci_request *ireq, u8 type, u8 op)
 	tc->app_tag_gen = 0;
 
 	if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2))
-		tc->ref_tag_seed_verify = scsi_get_lba(scmd) & 0xffffffff;
+		tc->ref_tag_seed_verify = lower_32_bits(scsi_get_sector(scmd));
 	else if (type & SCSI_PROT_DIF_TYPE3)
 		tc->ref_tag_seed_verify = 0;