Skip to contentSkip to conversation

IB-iSER: Adjustments for three function implementations

PATCH In review SF Markus Elfring 3 participants 7 messages Jan 27, 2018 – Jan 29, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover IB-iSER: Adjustments for three function implementations

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 19:02:34 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
Delete an error message for a failed memory allocation in iser_send_data_out() Delete an unnecessary variable initialisation in iser_send_data_out() Combine substrings for three messages

 drivers/infiniband/ulp/iser/iser_initiator.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/3 IB/iser: Delete an error message for a failed memory allocation in iser_send_data_out()

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 17:48:47 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/infiniband/ulp/iser/iser_initiator.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/infiniband/ulp/iser/iser_initiator.c +1 -3
index 2a07692007bd..3ae2571ba5b4 100644
@@ -452,10 +452,8 @@ int iser_send_data_out(struct iscsi_conn *conn,
 		 __func__,(int)itt,(int)data_seg_len,(int)buf_offset);
 
 	tx_desc = kmem_cache_zalloc(ig.desc_cache, GFP_ATOMIC);
-	if (tx_desc = NULL) {
-		iser_err("Failed to alloc desc for post dataout\n");
+	if (!tx_desc)
 		return -ENOMEM;
-	}
 
 	tx_desc->type = ISCSI_TX_DATAOUT;
 	tx_desc->cqe.done = iser_dataout_comp;
Signature · 1 line
2.16.1
#2 lore raw

PATCH 2/3 IB/iser: Delete an unnecessary variable initialisation in iser_send_data_out()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 17:55:13 +0100

The variable "tx_desc" will be set to an appropriate pointer a bit later. Thus omit the explicit initialisation at the beginning.

---
 drivers/infiniband/ulp/iser/iser_initiator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/iser/iser_initiator.c +1 -1
index 3ae2571ba5b4..1425c4957a04 100644
@@ -436,7 +436,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
 {
 	struct iser_conn *iser_conn = conn->dd_data;
 	struct iscsi_iser_task *iser_task = task->dd_data;
-	struct iser_tx_desc *tx_desc = NULL;
+	struct iser_tx_desc *tx_desc;
 	struct iser_mem_reg *mem_reg;
 	unsigned long buf_offset;
 	unsigned long data_seg_len;
Signature · 1 line
2.16.1
#3 lore raw

PATCH 3/3 IB/iser: Combine substrings for three messages

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 18:25:37 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: quoted string split across lines

Thus fix the affected source code places.

---
 drivers/infiniband/ulp/iser/iser_initiator.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/infiniband/ulp/iser/iser_initiator.c +4 -6
index 1425c4957a04..df49c4eb67f7 100644
@@ -142,8 +142,7 @@ iser_prepare_write_cmd(struct iscsi_task *task,
 			hdr->write_va = cpu_to_be64(mem_reg->sge.addr + unsol_sz);
 		}
 
-		iser_dbg("Cmd itt:%d, WRITE tags, RKEY:%#.4X "
-			 "VA:%#llX + unsol:%d\n",
+		iser_dbg("Cmd itt:%d, WRITE tags, RKEY:%#.4X VA:%#llX + unsol:%d\n",
 			 task->itt, mem_reg->rkey,
 			 (unsigned long long)mem_reg->sge.addr, unsol_sz);
 	}
@@ -473,8 +472,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
 	tx_desc->num_sge = 2;
 
 	if (buf_offset + data_seg_len > iser_task->data[ISER_DIR_OUT].data_len) {
-		iser_err("Offset:%ld & DSL:%ld in Data-Out "
-			 "inconsistent with total len:%ld, itt:%d\n",
+		iser_err("Offset:%ld & DSL:%ld in Data-Out inconsistent with total len:%ld, itt:%d\n",
 			 buf_offset, data_seg_len,
 			 iser_task->data[ISER_DIR_OUT].data_len, itt);
 		err = -EINVAL;
@@ -612,8 +610,8 @@ iser_check_remote_inv(struct iser_conn *iser_conn,
 			 iser_conn, rkey);
 
 		if (unlikely(!iser_conn->snd_w_inv)) {
-			iser_err("conn %p: unexpected remote invalidation, "
-				 "terminating connection\n", iser_conn);
+			iser_err("conn %p: unexpected remote invalidation, terminating connection\n",
+				 iser_conn);
 			return -EPROTO;
 		}
 
Signature · 1 line
2.16.1
Reviewed-by on the v1 series
#4 lore raw
In reply to SF Markus Elfring
Quoted 6 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 19:02:34 +0100

Three update suggestions were taken into account
from static source code analysis.

Quoted 8 lines

Markus Elfring (3):
Delete an error message for a failed memory allocation in iser_send_data_out() Delete an unnecessary variable initialisation in iser_send_data_out() Combine substrings for three messages

  drivers/infiniband/ulp/iser/iser_initiator.c | 16 ++++++----------
  1 file changed, 6 insertions(+), 10 deletions(-)

This series looks good to me,

#5 lore raw
Quoted 14 lines · Max Gurtovoy
Quoted 11 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 19:02:34 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
Delete an error message for a failed memory allocation in iser_send_data_out() Delete an unnecessary variable initialisation in iser_send_data_out() Combine substrings for three messages

Quoted 7 lines
Quoted 3 lines
 drivers/infiniband/ulp/iser/iser_initiator.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

This series looks good to me,

Okay, applied to for-next, thanks both

Jason