scsi: smartpqi: scsi queuecommand cleanup
authorKevin Barnett <kevin.barnett@microsemi.com>
Wed, 31 Aug 2016 19:55:11 +0000 (14:55 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 2 Sep 2016 10:21:38 +0000 (06:21 -0400)
minor cleanup of scsi queue command function

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c

index db248c15adafa91e6271f929ddd5e790dc272b09..f0672ed416cbce2e5e09eb1fdb45e4956fd45228 100644 (file)
@@ -4514,7 +4514,7 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info *ctrl_info,
 }
 
 static int pqi_scsi_queue_command(struct Scsi_Host *shost,
-                               struct scsi_cmnd *scmd)
+       struct scsi_cmnd *scmd)
 {
        int rc;
        struct pqi_ctrl_info *ctrl_info;
@@ -4532,6 +4532,12 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost,
                return 0;
        }
 
+       /*
+        * This is necessary because the SML doesn't zero out this field during
+        * error recovery.
+        */
+       scmd->result = 0;
+
        hwq = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(scmd->request));
        if (hwq >= ctrl_info->num_queue_groups)
                hwq = 0;