diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-06-11 19:44:46 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:01:51 -0400 |
commit | 0db6f4353d68c0108b5fe0bad8259de0197589c6 (patch) | |
tree | e26d28355b6aa8c8b3995406823f1ec9ccfeb070 | |
parent | 1c4bfe6305215f09f3e80a14a824e4ae45b2c7ed (diff) |
[SCSI] fnic: fnic_scsi.c: clean up
In fnic_abort_cmd() and fnic_device_reset() assign `rport' earlier to make
FNIC_SCSI_DBG() calls cleaner.
In fnic_clean_pending_aborts() `rport' is not used.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/fnic/fnic_scsi.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 3cc47c6e1ada..198cbab3e894 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c | |||
@@ -1246,11 +1246,10 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) | |||
1246 | lp = shost_priv(sc->device->host); | 1246 | lp = shost_priv(sc->device->host); |
1247 | 1247 | ||
1248 | fnic = lport_priv(lp); | 1248 | fnic = lport_priv(lp); |
1249 | FNIC_SCSI_DBG(KERN_DEBUG, | 1249 | rport = starget_to_rport(scsi_target(sc->device)); |
1250 | fnic->lport->host, | 1250 | FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, |
1251 | "Abort Cmd called FCID 0x%x, LUN 0x%x TAG %d\n", | 1251 | "Abort Cmd called FCID 0x%x, LUN 0x%x TAG %d\n", |
1252 | (starget_to_rport(scsi_target(sc->device)))->port_id, | 1252 | rport->port_id, sc->device->lun, sc->request->tag); |
1253 | sc->device->lun, sc->request->tag); | ||
1254 | 1253 | ||
1255 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) { | 1254 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) { |
1256 | ret = FAILED; | 1255 | ret = FAILED; |
@@ -1299,7 +1298,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) | |||
1299 | * port is up, then send abts to the remote port to terminate | 1298 | * port is up, then send abts to the remote port to terminate |
1300 | * the IO. Else, just locally terminate the IO in the firmware | 1299 | * the IO. Else, just locally terminate the IO in the firmware |
1301 | */ | 1300 | */ |
1302 | rport = starget_to_rport(scsi_target(sc->device)); | ||
1303 | if (fc_remote_port_chkready(rport) == 0) | 1301 | if (fc_remote_port_chkready(rport) == 0) |
1304 | task_req = FCPIO_ITMF_ABT_TASK; | 1302 | task_req = FCPIO_ITMF_ABT_TASK; |
1305 | else | 1303 | else |
@@ -1418,7 +1416,6 @@ static int fnic_clean_pending_aborts(struct fnic *fnic, | |||
1418 | unsigned long flags; | 1416 | unsigned long flags; |
1419 | int ret = 0; | 1417 | int ret = 0; |
1420 | struct scsi_cmnd *sc; | 1418 | struct scsi_cmnd *sc; |
1421 | struct fc_rport *rport; | ||
1422 | struct scsi_lun fc_lun; | 1419 | struct scsi_lun fc_lun; |
1423 | struct scsi_device *lun_dev = lr_sc->device; | 1420 | struct scsi_device *lun_dev = lr_sc->device; |
1424 | DECLARE_COMPLETION_ONSTACK(tm_done); | 1421 | DECLARE_COMPLETION_ONSTACK(tm_done); |
@@ -1458,7 +1455,6 @@ static int fnic_clean_pending_aborts(struct fnic *fnic, | |||
1458 | 1455 | ||
1459 | /* Now queue the abort command to firmware */ | 1456 | /* Now queue the abort command to firmware */ |
1460 | int_to_scsilun(sc->device->lun, &fc_lun); | 1457 | int_to_scsilun(sc->device->lun, &fc_lun); |
1461 | rport = starget_to_rport(scsi_target(sc->device)); | ||
1462 | 1458 | ||
1463 | if (fnic_queue_abort_io_req(fnic, tag, | 1459 | if (fnic_queue_abort_io_req(fnic, tag, |
1464 | FCPIO_ITMF_ABT_TASK_TERM, | 1460 | FCPIO_ITMF_ABT_TASK_TERM, |
@@ -1528,18 +1524,16 @@ int fnic_device_reset(struct scsi_cmnd *sc) | |||
1528 | lp = shost_priv(sc->device->host); | 1524 | lp = shost_priv(sc->device->host); |
1529 | 1525 | ||
1530 | fnic = lport_priv(lp); | 1526 | fnic = lport_priv(lp); |
1531 | FNIC_SCSI_DBG(KERN_DEBUG, | ||
1532 | fnic->lport->host, | ||
1533 | "Device reset called FCID 0x%x, LUN 0x%x\n", | ||
1534 | (starget_to_rport(scsi_target(sc->device)))->port_id, | ||
1535 | sc->device->lun); | ||
1536 | 1527 | ||
1528 | rport = starget_to_rport(scsi_target(sc->device)); | ||
1529 | FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, | ||
1530 | "Device reset called FCID 0x%x, LUN 0x%x\n", | ||
1531 | rport->port_id, sc->device->lun); | ||
1537 | 1532 | ||
1538 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) | 1533 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) |
1539 | goto fnic_device_reset_end; | 1534 | goto fnic_device_reset_end; |
1540 | 1535 | ||
1541 | /* Check if remote port up */ | 1536 | /* Check if remote port up */ |
1542 | rport = starget_to_rport(scsi_target(sc->device)); | ||
1543 | if (fc_remote_port_chkready(rport)) | 1537 | if (fc_remote_port_chkready(rport)) |
1544 | goto fnic_device_reset_end; | 1538 | goto fnic_device_reset_end; |
1545 | 1539 | ||