diff mbox series

[v5,13/52] aacraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

Message ID 20210809230355.8186-14-bvanassche@acm.org
State New
Headers show
Series [v5,01/52] core: Introduce the scsi_cmd_to_rq() function | expand

Commit Message

Bart Van Assche Aug. 9, 2021, 11:03 p.m. UTC
Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aacraid/aachba.c  | 2 +-
 drivers/scsi/aacraid/commsup.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Hannes Reinecke Aug. 10, 2021, 6:23 a.m. UTC | #1
On 8/10/21 1:03 AM, Bart Van Assche wrote:
> Prepare for removal of the request pointer by using scsi_cmd_to_rq()

> instead. This patch does not change any functionality.

> 

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

> ---

>   drivers/scsi/aacraid/aachba.c  | 2 +-

>   drivers/scsi/aacraid/commsup.c | 2 +-

>   2 files changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c

> index 267934d2f14b..c2d6f0a9e0b1 100644

> --- a/drivers/scsi/aacraid/aachba.c

> +++ b/drivers/scsi/aacraid/aachba.c

> @@ -1504,7 +1504,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd

>   	srbcmd->id       = cpu_to_le32(scmd_id(cmd));

>   	srbcmd->lun      = cpu_to_le32(cmd->device->lun);

>   	srbcmd->flags    = cpu_to_le32(flag);

> -	timeout = cmd->request->timeout/HZ;

> +	timeout = scsi_cmd_to_rq(cmd)->timeout / HZ;

>   	if (timeout == 0)

>   		timeout = (dev->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT);

>   	srbcmd->timeout  = cpu_to_le32(timeout);  // timeout in seconds

> diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c

> index 54eb4d41bc2c..deb32c9f4b3e 100644

> --- a/drivers/scsi/aacraid/commsup.c

> +++ b/drivers/scsi/aacraid/commsup.c

> @@ -224,7 +224,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd)

>   {

>   	struct fib *fibptr;

>   

> -	fibptr = &dev->fibs[scmd->request->tag];

> +	fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag];

>   	/*

>   	 *	Null out fields that depend on being zero at the start of

>   	 *	each I/O

> 


The 'scsi_cmd_to_rq(scmd)->tag' pattern is becoming more and more 
visible; maybe one should introduce a helper for it?

Other than that:

Reviewed-by: Hannes Reinecke <hare@suse.de>


Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
diff mbox series

Patch

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 267934d2f14b..c2d6f0a9e0b1 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1504,7 +1504,7 @@  static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd
 	srbcmd->id       = cpu_to_le32(scmd_id(cmd));
 	srbcmd->lun      = cpu_to_le32(cmd->device->lun);
 	srbcmd->flags    = cpu_to_le32(flag);
-	timeout = cmd->request->timeout/HZ;
+	timeout = scsi_cmd_to_rq(cmd)->timeout / HZ;
 	if (timeout == 0)
 		timeout = (dev->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT);
 	srbcmd->timeout  = cpu_to_le32(timeout);  // timeout in seconds
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 54eb4d41bc2c..deb32c9f4b3e 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -224,7 +224,7 @@  struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd)
 {
 	struct fib *fibptr;
 
-	fibptr = &dev->fibs[scmd->request->tag];
+	fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag];
 	/*
 	 *	Null out fields that depend on being zero at the start of
 	 *	each I/O