mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
iscsi-scst: Simplify iscsi_get_initiator_port_transport_id()
From the snprintf() man page:
If n is zero, nothing shall be written and s may be a null pointer.
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3950,7 +3950,6 @@ static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
union iscsi_sid sid;
|
||||
int tr_id_size;
|
||||
uint8_t *tr_id;
|
||||
uint8_t q;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -3965,7 +3964,7 @@ static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
sid.id.tsih = 0;
|
||||
|
||||
tr_id_size = 4 + strlen(sess->initiator_name) + 5 +
|
||||
snprintf(&q, sizeof(q), "%llx", sid.id64) + 1;
|
||||
snprintf(NULL, 0, "%llx", sid.id64) + 1;
|
||||
tr_id_size = (tr_id_size + 3) & -4;
|
||||
|
||||
tr_id = kzalloc(tr_id_size, GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user