iscsi: eliminate pointless temporary log buffer
SPDK_NOTICELOG() can already do printf()-style formatting, so there is no need to use snprintf() on a temporary buffer first. Change-Id: Iffb5369b74f27fb2c4b3ac07ea0cdeab52258ba1 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
df56ab7711
commit
2e9cd2cd77
@ -2034,14 +2034,13 @@ static int
|
|||||||
spdk_iscsi_op_login_notify_session_info(struct spdk_iscsi_conn *conn,
|
spdk_iscsi_op_login_notify_session_info(struct spdk_iscsi_conn *conn,
|
||||||
struct spdk_iscsi_pdu *rsp_pdu)
|
struct spdk_iscsi_pdu *rsp_pdu)
|
||||||
{
|
{
|
||||||
char buf[MAX_TMPBUF];
|
|
||||||
struct spdk_iscsi_portal *portal = conn->portal;
|
struct spdk_iscsi_portal *portal = conn->portal;
|
||||||
struct iscsi_bhs_login_rsp *rsph;
|
struct iscsi_bhs_login_rsp *rsph;
|
||||||
|
|
||||||
rsph = (struct iscsi_bhs_login_rsp *) & (rsp_pdu->bhs);
|
rsph = (struct iscsi_bhs_login_rsp *) & (rsp_pdu->bhs);
|
||||||
if (conn->sess->session_type == SESSION_TYPE_NORMAL) {
|
if (conn->sess->session_type == SESSION_TYPE_NORMAL) {
|
||||||
/* normal session */
|
/* normal session */
|
||||||
snprintf(buf, sizeof buf, "Login from %s (%s) on %s tgt_node%d"
|
SPDK_NOTICELOG("Login from %s (%s) on %s tgt_node%d"
|
||||||
" (%s:%s,%d), ISID=%"PRIx64", TSIH=%u,"
|
" (%s:%s,%d), ISID=%"PRIx64", TSIH=%u,"
|
||||||
" CID=%u, HeaderDigest=%s, DataDigest=%s\n",
|
" CID=%u, HeaderDigest=%s, DataDigest=%s\n",
|
||||||
conn->initiator_name, conn->initiator_addr,
|
conn->initiator_name, conn->initiator_addr,
|
||||||
@ -2052,10 +2051,9 @@ spdk_iscsi_op_login_notify_session_info(struct spdk_iscsi_conn *conn,
|
|||||||
? "on" : "off"),
|
? "on" : "off"),
|
||||||
(spdk_iscsi_param_eq_val(conn->params, "DataDigest", "CRC32C")
|
(spdk_iscsi_param_eq_val(conn->params, "DataDigest", "CRC32C")
|
||||||
? "on" : "off"));
|
? "on" : "off"));
|
||||||
SPDK_NOTICELOG("%s", buf);
|
|
||||||
} else if (conn->sess->session_type == SESSION_TYPE_DISCOVERY) {
|
} else if (conn->sess->session_type == SESSION_TYPE_DISCOVERY) {
|
||||||
/* discovery session */
|
/* discovery session */
|
||||||
snprintf(buf, sizeof buf, "Login(discovery) from %s (%s) on"
|
SPDK_NOTICELOG("Login(discovery) from %s (%s) on"
|
||||||
" (%s:%s,%d), ISID=%"PRIx64", TSIH=%u,"
|
" (%s:%s,%d), ISID=%"PRIx64", TSIH=%u,"
|
||||||
" CID=%u, HeaderDigest=%s, DataDigest=%s\n",
|
" CID=%u, HeaderDigest=%s, DataDigest=%s\n",
|
||||||
conn->initiator_name, conn->initiator_addr,
|
conn->initiator_name, conn->initiator_addr,
|
||||||
@ -2065,7 +2063,6 @@ spdk_iscsi_op_login_notify_session_info(struct spdk_iscsi_conn *conn,
|
|||||||
? "on" : "off"),
|
? "on" : "off"),
|
||||||
(spdk_iscsi_param_eq_val(conn->params, "DataDigest", "CRC32C")
|
(spdk_iscsi_param_eq_val(conn->params, "DataDigest", "CRC32C")
|
||||||
? "on" : "off"));
|
? "on" : "off"));
|
||||||
SPDK_NOTICELOG("%s", buf);
|
|
||||||
} else {
|
} else {
|
||||||
SPDK_ERRLOG("unknown session type\n");
|
SPDK_ERRLOG("unknown session type\n");
|
||||||
/* Initiator error */
|
/* Initiator error */
|
||||||
|
Loading…
Reference in New Issue
Block a user