lib/iscsi: Use not double pointer but reference to pointer in iscsi_op_login()

Double pointer is clever but reference to pointer is easier to understand
because it may be familiar and reference to pointer has been used
for alloc_len and cid in the same function.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9b8f886bd99d3ab5b9c82c72a040816b398b308f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470266
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-10-03 09:08:25 +09:00 committed by Changpeng Liu
parent d895ea6053
commit c9e90fd05e

View File

@ -2378,7 +2378,6 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
int rc;
struct spdk_iscsi_pdu *rsp_pdu;
struct iscsi_param *params = NULL;
struct iscsi_param **params_p = &params;
int alloc_len;
int cid;
@ -2391,10 +2390,10 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
if (rsp_pdu == NULL) {
return SPDK_ISCSI_CONNECTION_FATAL;
}
rc = iscsi_op_login_rsp_init(conn, pdu, rsp_pdu, params_p,
rc = iscsi_op_login_rsp_init(conn, pdu, rsp_pdu, &params,
&alloc_len, &cid);
if (rc == SPDK_ISCSI_LOGIN_ERROR_RESPONSE || rc == SPDK_ISCSI_LOGIN_ERROR_PARAMETER) {
iscsi_op_login_response(conn, rsp_pdu, *params_p);
iscsi_op_login_response(conn, rsp_pdu, params);
return rc;
}
@ -2405,21 +2404,21 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
}
if (conn->state == ISCSI_CONN_STATE_INVALID) {
rc = iscsi_op_login_phase_none(conn, rsp_pdu, *params_p,
rc = iscsi_op_login_phase_none(conn, rsp_pdu, params,
alloc_len, cid);
if (rc == SPDK_ISCSI_LOGIN_ERROR_RESPONSE || rc == SPDK_ISCSI_LOGIN_ERROR_PARAMETER) {
iscsi_op_login_response(conn, rsp_pdu, *params_p);
iscsi_op_login_response(conn, rsp_pdu, params);
return rc;
}
}
rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, params_p, alloc_len);
rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, &params, alloc_len);
if (rc == SPDK_ISCSI_LOGIN_ERROR_RESPONSE) {
iscsi_op_login_response(conn, rsp_pdu, *params_p);
iscsi_op_login_response(conn, rsp_pdu, params);
return rc;
}
rc = iscsi_op_login_response(conn, rsp_pdu, *params_p);
rc = iscsi_op_login_response(conn, rsp_pdu, params);
if (rc == 0) {
conn->state = ISCSI_CONN_STATE_RUNNING;
if (conn->full_feature != 0) {