aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fc.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-07-02 04:56:37 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:35 -0400
commit317e6b6519b5a34263a33f150ed57ad468b26a64 (patch)
tree074a35c260d567911b009fd70b83940cdd254bbd /drivers/s390/scsi/zfcp_fc.c
parentf76af7d7e36373179be7a9e09f6b0aae330549b7 (diff)
[SCSI] zfcp: Cleanup of code in zfcp_aux.c
Overall cleanup of zfcp_aux.c to simplify code and follow kernel coding style. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.c')
-rw-r--r--drivers/s390/scsi/zfcp_fc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 5d9367d9a12d..fbe2c76df4d7 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -39,6 +39,18 @@ struct zfcp_gpn_ft {
39 struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS]; 39 struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS];
40}; 40};
41 41
42static struct zfcp_port *zfcp_get_port_by_did(struct zfcp_adapter *adapter,
43 u32 d_id)
44{
45 struct zfcp_port *port;
46
47 list_for_each_entry(port, &adapter->port_list_head, list)
48 if ((port->d_id == d_id) &&
49 !atomic_test_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status))
50 return port;
51 return NULL;
52}
53
42static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, 54static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
43 struct fcp_rscn_element *elem) 55 struct fcp_rscn_element *elem)
44{ 56{
@@ -496,10 +508,10 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
496 port = zfcp_port_enqueue(adapter, acc->wwpn, 508 port = zfcp_port_enqueue(adapter, acc->wwpn,
497 ZFCP_STATUS_PORT_DID_DID | 509 ZFCP_STATUS_PORT_DID_DID |
498 ZFCP_STATUS_COMMON_NOESC, d_id); 510 ZFCP_STATUS_COMMON_NOESC, d_id);
499 if (port) 511 if (IS_ERR(port))
500 zfcp_erp_port_reopen(port, 0, 149, NULL); 512 ret = PTR_ERR(port);
501 else 513 else
502 ret = -ENOMEM; 514 zfcp_erp_port_reopen(port, 0, 149, NULL);
503 if (acc->control & 0x80) /* last entry */ 515 if (acc->control & 0x80) /* last entry */
504 break; 516 break;
505 } 517 }