scsi: hpsa: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
authorBart Van Assche <bvanassche@acm.org>
Mon, 9 Aug 2021 23:03:25 +0000 (16:03 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Aug 2021 02:25:39 +0000 (22:25 -0400)
Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-23-bvanassche@acm.org
Acked-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c

index f135a10f582bc0f92fa3afa406aac6f37bc14b48..3faa87fa296a2df10ab5c1b56158af4dd2222627 100644 (file)
@@ -5686,7 +5686,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
        /* Get the ptr to our adapter structure out of cmd->host. */
        h = sdev_to_hba(cmd->device);
 
-       BUG_ON(cmd->request->tag < 0);
+       BUG_ON(scsi_cmd_to_rq(cmd)->tag < 0);
 
        dev = cmd->device->hostdata;
        if (!dev) {
@@ -5729,7 +5729,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
         *       and is therefore a brand-new command.
         */
        if (likely(cmd->retries == 0 &&
-                       !blk_rq_is_passthrough(cmd->request) &&
+                       !blk_rq_is_passthrough(scsi_cmd_to_rq(cmd)) &&
                        h->acciopath_status)) {
                /* Submit with the retry_pending flag unset. */
                rc = hpsa_ioaccel_submit(h, c, cmd, false);
@@ -5894,7 +5894,7 @@ static int hpsa_scsi_add_host(struct ctlr_info *h)
  */
 static int hpsa_get_cmd_index(struct scsi_cmnd *scmd)
 {
-       int idx = scmd->request->tag;
+       int idx = scsi_cmd_to_rq(scmd)->tag;
 
        if (idx < 0)
                return idx;