Commit 185f2d2d authored by Jens Remus's avatar Jens Remus Committed by Martin K. Petersen

scsi: zfcp: auto variables for dereferenced structs in open port handler

Introduce automatic variables for adapter and QTCB bottom in
zfcp_fsf_open_port_handler(). This facilitates subsequent changes to meet
the 80 character per line limit.

Link: https://lore.kernel.org/r/20200312174505.51294-6-maier@linux.ibm.comReviewed-by: default avatarFedor Loshakov <loshakov@linux.ibm.com>
Reviewed-by: default avatarSteffen Maier <maier@linux.ibm.com>
Reviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: default avatarJens Remus <jremus@linux.ibm.com>
Signed-off-by: default avatarSteffen Maier <maier@linux.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7e0e4e09
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Implementation of FSF commands. * Implementation of FSF commands.
* *
* Copyright IBM Corp. 2002, 2018 * Copyright IBM Corp. 2002, 2020
*/ */
#define KMSG_COMPONENT "zfcp" #define KMSG_COMPONENT "zfcp"
...@@ -1499,8 +1499,10 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_qdio *qdio, ...@@ -1499,8 +1499,10 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_qdio *qdio,
static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
{ {
struct zfcp_adapter *adapter = req->adapter;
struct zfcp_port *port = req->data; struct zfcp_port *port = req->data;
struct fsf_qtcb_header *header = &req->qtcb->header; struct fsf_qtcb_header *header = &req->qtcb->header;
struct fsf_qtcb_bottom_support *bottom = &req->qtcb->bottom.support;
struct fc_els_flogi *plogi; struct fc_els_flogi *plogi;
if (req->status & ZFCP_STATUS_FSFREQ_ERROR) if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
...@@ -1510,7 +1512,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) ...@@ -1510,7 +1512,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
case FSF_PORT_ALREADY_OPEN: case FSF_PORT_ALREADY_OPEN:
break; break;
case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
dev_warn(&req->adapter->ccw_device->dev, dev_warn(&adapter->ccw_device->dev,
"Not enough FCP adapter resources to open " "Not enough FCP adapter resources to open "
"remote port 0x%016Lx\n", "remote port 0x%016Lx\n",
(unsigned long long)port->wwpn); (unsigned long long)port->wwpn);
...@@ -1550,10 +1552,9 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) ...@@ -1550,10 +1552,9 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
* another GID_PN straight after a port has been opened. * another GID_PN straight after a port has been opened.
* Alternately, an ADISC/PDISC ELS should suffice, as well. * Alternately, an ADISC/PDISC ELS should suffice, as well.
*/ */
plogi = (struct fc_els_flogi *) req->qtcb->bottom.support.els; plogi = (struct fc_els_flogi *) bottom->els;
if (req->qtcb->bottom.support.els1_length >= if (bottom->els1_length >= FSF_PLOGI_MIN_LEN)
FSF_PLOGI_MIN_LEN) zfcp_fc_plogi_evaluate(port, plogi);
zfcp_fc_plogi_evaluate(port, plogi);
break; break;
case FSF_UNKNOWN_OP_SUBTYPE: case FSF_UNKNOWN_OP_SUBTYPE:
req->status |= ZFCP_STATUS_FSFREQ_ERROR; req->status |= ZFCP_STATUS_FSFREQ_ERROR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment