From 57fe0394a36c4b105c892eb1bb59aeb30cb6b520 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 4 Jun 2019 16:45:12 +0900 Subject: [PATCH] iscsi: Use 0 instead of SPDK_SUCCESS in spdk_iscsi_read_pdu to match caller spdk_iscsi_read_pdu has been used only in a place, iscsi_conn_handle_incoming_pdus. iscsi_conn_handle_incoming_pdus classifies return code of spdk_iscsi_read_pdu to SPDK_ISCSI_CONNECTION_FATAL, 0, or 1. Using 0 instead of SPDK_SUCCESS in spdk_iscsi_read_pdu matches iscsi_conn_handle_incoming_pdus and is done in this patch. Signed-off-by: Shuhei Matsumoto Change-Id: I231c2e70a094c26af2c8eb60d77b92d880674901 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456770 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ziye Yang Reviewed-by: Darek Stojaczyk --- lib/iscsi/iscsi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index fd4295fe1b..4b4ecf29a6 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -427,7 +427,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->bhs_valid_bytes += rc; if (pdu->bhs_valid_bytes < ISCSI_BHS_LEN) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } } @@ -447,7 +447,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->ahs_valid_bytes += rc; if (pdu->ahs_valid_bytes < ahs_len) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } } @@ -464,7 +464,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->hdigest_valid_bytes += rc; if (pdu->hdigest_valid_bytes < ISCSI_DIGEST_LEN) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } } @@ -485,7 +485,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->mobj = spdk_mempool_get(pool); if (pdu->mobj == NULL) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } pdu->data_buf = pdu->mobj->buf; } @@ -498,7 +498,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->data_valid_bytes += rc; if (pdu->data_valid_bytes < data_len) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } } @@ -515,7 +515,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) pdu->ddigest_valid_bytes += rc; if (pdu->ddigest_valid_bytes < ISCSI_DIGEST_LEN) { *_pdu = NULL; - return SPDK_SUCCESS; + return 0; } } @@ -537,7 +537,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu) */ if (rc == 0) { spdk_put_pdu(pdu); - return SPDK_SUCCESS; + return 0; } else { goto error; }