From 1be062decd128ca2f22f9f9d3657333579d333bb Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Mon, 26 Sep 2016 10:57:40 +0800 Subject: [PATCH] iscsi: Extract common statements in spdk_iscsi_append_text Also this patch removes the unnecessary empty line Change-Id: I2db31b88796e57298a7df59945868ee7a7750290 Signed-off-by: Ziye Yang --- lib/iscsi/iscsi.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 2f136890b..6ab957ea0 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -633,9 +633,6 @@ spdk_iscsi_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) TAILQ_INSERT_TAIL(&conn->write_pdu_list, pdu, tailq); } - - - static int spdk_iscsi_append_text(struct spdk_iscsi_conn *conn __attribute__(( __unused__)), const char *key, const char *val, uint8_t *data, int alloc_len, @@ -1094,15 +1091,13 @@ spdk_iscsi_reject(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu, DSET24(rsph->data_segment_len, data_len); rsph->ffffffff = 0xffffffffU; + to_be32(&rsph->stat_sn, conn->StatSN); + conn->StatSN++; if (conn->sess != NULL) { - to_be32(&rsph->stat_sn, conn->StatSN); - conn->StatSN++; to_be32(&rsph->exp_cmd_sn, conn->sess->ExpCmdSN); to_be32(&rsph->max_cmd_sn, conn->sess->MaxCmdSN); } else { - to_be32(&rsph->stat_sn, conn->StatSN); - conn->StatSN++; to_be32(&rsph->exp_cmd_sn, 1); to_be32(&rsph->max_cmd_sn, 1); }