lib/iscsi: Use not double pointer but reference to pointer in iscsi_op_text()
Double pointer is clever but reference to pointer is easier to understand. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I5168e08ca67942c22ba2cbdc10925e8a9fd6da6c Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471007 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
8f3fa385b7
commit
032a2b60fe
@ -2219,7 +2219,6 @@ static int
|
|||||||
iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||||
{
|
{
|
||||||
struct iscsi_param *params = NULL;
|
struct iscsi_param *params = NULL;
|
||||||
struct iscsi_param **params_p = ¶ms;
|
|
||||||
struct spdk_iscsi_pdu *rsp_pdu;
|
struct spdk_iscsi_pdu *rsp_pdu;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
uint64_t lun;
|
uint64_t lun;
|
||||||
@ -2305,17 +2304,17 @@ iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* negotiate parameters */
|
/* negotiate parameters */
|
||||||
data_len = spdk_iscsi_negotiate_params(conn, params_p,
|
data_len = spdk_iscsi_negotiate_params(conn, ¶ms,
|
||||||
data, alloc_len, data_len);
|
data, alloc_len, data_len);
|
||||||
if (data_len < 0) {
|
if (data_len < 0) {
|
||||||
SPDK_ERRLOG("spdk_iscsi_negotiate_params() failed\n");
|
SPDK_ERRLOG("spdk_iscsi_negotiate_params() failed\n");
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
free(data);
|
free(data);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sendtargets is special case */
|
/* sendtargets is special case */
|
||||||
val = spdk_iscsi_param_get_val(*params_p, "SendTargets");
|
val = spdk_iscsi_param_get_val(params, "SendTargets");
|
||||||
if (val != NULL) {
|
if (val != NULL) {
|
||||||
if (spdk_iscsi_param_eq_val(conn->sess->params,
|
if (spdk_iscsi_param_eq_val(conn->sess->params,
|
||||||
"SessionType", "Discovery")) {
|
"SessionType", "Discovery")) {
|
||||||
@ -2349,7 +2348,7 @@ iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (spdk_iscsi_param_eq_val(conn->sess->params, "SessionType", "Discovery")) {
|
if (spdk_iscsi_param_eq_val(conn->sess->params, "SessionType", "Discovery")) {
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
free(data);
|
free(data);
|
||||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||||
}
|
}
|
||||||
@ -2360,7 +2359,7 @@ iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
/* response PDU */
|
/* response PDU */
|
||||||
rsp_pdu = spdk_get_pdu();
|
rsp_pdu = spdk_get_pdu();
|
||||||
if (rsp_pdu == NULL) {
|
if (rsp_pdu == NULL) {
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
free(data);
|
free(data);
|
||||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||||
}
|
}
|
||||||
@ -2404,7 +2403,7 @@ iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
rc = spdk_iscsi_copy_param2var(conn);
|
rc = spdk_iscsi_copy_param2var(conn);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_ERRLOG("spdk_iscsi_copy_param2var() failed\n");
|
SPDK_ERRLOG("spdk_iscsi_copy_param2var() failed\n");
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2412,11 +2411,11 @@ iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
rc = iscsi_check_values(conn);
|
rc = iscsi_check_values(conn);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_ERRLOG("iscsi_check_values() failed\n");
|
SPDK_ERRLOG("iscsi_check_values() failed\n");
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_iscsi_param_free(*params_p);
|
spdk_iscsi_param_free(params);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user