IB-iSER: Adjustments for three function implementations
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
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
@@ -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
PATCH 2/3 IB/iser: Delete an unnecessary variable initialisation in iser_send_data_out()
In reply to SF Markus ElfringFrom: 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
@@ -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
PATCH 3/3 IB/iser: Combine substrings for three messages
In reply to SF Markus ElfringFrom: 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
@@ -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
Quoted 6 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 19:02:34 +0100Three 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 iniser_send_data_out()Delete an unnecessary variable initialisation iniser_send_data_out()Combine substrings for three messagesdrivers/infiniband/ulp/iser/iser_initiator.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
This series looks good to me,
Quoted 14 lines · Max Gurtovoy
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 27 Jan 2018 19:02:34 +0100Three update suggestions were taken into account
from static source code analysis.Markus Elfring (3):
Delete an error message for a failed memory allocation iniser_send_data_out()Delete an unnecessary variable initialisation iniser_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,
Reviewed-by Max Gurtovoy <[email protected]>
Okay, applied to for-next, thanks both
Jason
Quoted 1 line
Okay, applied to for-next, thanks both
Thanks for your acceptance.
How are the chances for integration of further software updates from my selection of change possibilities?
Example:
IB/iser: Add spaces for better code readability
https://lkml.org/lkml/2017/4/7/667
https://patchwork.kernel.org/patch/9670439/
https://lkml.kernel.org/r/<[email protected]>
Regards,
Markus