diff mbox

[2/6] ipr: Remove redundant initialization

Message ID 20170315215838.237B86A03B@b03ledav003.gho.boulder.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Brian King March 15, 2017, 9:58 p.m. UTC
Removes some code in __ipr_eh_dev_reset which was modifying the
ipr_cmd done function. This should have already been setup at
command allocation time and if its since been changed, it means
we are in the ipr_erp* functions and need to wait for them to
complete and don't want to override that here.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 drivers/scsi/ipr.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox

Patch

diff -puN drivers/scsi/ipr.c~ipr_eh_dev_reset_unnecessary_reinit drivers/scsi/ipr.c
--- linux-2.6.git/drivers/scsi/ipr.c~ipr_eh_dev_reset_unnecessary_reinit	2017-03-13 15:53:29.636591281 -0500
+++ linux-2.6.git-bjking1/drivers/scsi/ipr.c	2017-03-13 15:53:29.642591257 -0500
@@ -5243,12 +5243,11 @@  static int __ipr_eh_dev_reset(struct scs
 		spin_lock(&hrrq->_lock);
 		list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
 			if (ipr_cmd->ioarcb.res_handle == res->res_handle) {
-				if (ipr_cmd->scsi_cmd)
-					ipr_cmd->done = ipr_scsi_eh_done;
-				if (ipr_cmd->qc)
-					ipr_cmd->done = ipr_sata_eh_done;
-				if (ipr_cmd->qc &&
-				    !(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) {
+				if (!ipr_cmd->qc)
+					continue;
+
+				ipr_cmd->done = ipr_sata_eh_done;
+				if (!(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) {
 					ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT;
 					ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED;
 				}