IB/isert: remove unneeded new lines
Subsystems (2)
PATCH 1/3 IB/isert: remove unneeded new lines
The Linux convention is to have only 1 new line between functions.
--- drivers/infiniband/ulp/isert/ib_isert.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +0 -2
@@ -71,7 +71,6 @@ static int isert_sg_tablesize_set(const char *val, const struct kernel_param *kpreturn param_set_int (val, kp); } -static inline bool isert_prot_cmd (struct isert_conn *conn,struct se_cmd *cmd) {
@@ -79,7 +78,6 @@ isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd) cmd->prot_op != TARGET_PROT_NORMAL); } -static void isert_qp_event_callback (struct ib_event *e,void *context) {
Signature · 1 line
2.25.4
PATCH 2/3 IB/isert: remove unneeded semicolon
No need to add semicolon after closing bracket.
--- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/isert/ib_isert.c +1 -1
@@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)if (se_cmd->prot_type ==TARGET_DIF_TYPE1_PROT || se_cmd->prot_type ==TARGET_DIF_TYPE2_PROT ) domain->sig.dif.ref_remap = true; -}; +}static int isert_set_sig_attrs (struct se_cmd *se_cmd,struct ib_sig_attrs *sig_attrs)
Signature · 1 line
2.25.4
Leon Romanovsky
maintainerRe: [PATCH 2/3] IB/isert: remove unneeded semicolon
Quoted 13 lines · Max Gurtovoy
No need to add semicolon after closing bracket.
Reviewed-by Israel Rukshin <[email protected]>Signed-off-by Max Gurtovoy <[email protected]>--- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/ulp/isert/ib_isert.c +0
-0
drivers/infiniband/ulp/isert/ib_isert.c isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain) · line 1994
Quoted 5 lines
drivers/infiniband/ulp/isert/ib_isert.c +1
-1@@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)if (se_cmd->prot_type ==TARGET_DIF_TYPE1_PROT || se_cmd->prot_type ==TARGET_DIF_TYPE2_PROT ) domain->sig.dif.ref_remap = true; -}; +}
The same goes for iser_set_dif_domain() and iser_cleanup_handler().
Thanks
Quoted 6 lines
drivers/infiniband/ulp/isert/ib_isert.c +0
-1static int isert_set_sig_attrs (struct se_cmd *se_cmd,struct ib_sig_attrs *sig_attrs) --2.25.4
Re: [PATCH 2/3] IB/isert: remove unneeded semicolon
Quoted 9 lines · Leon Romanovsky
Quoted 8 lines · Max Gurtovoy
No need to add semicolon after closing bracket.
Reviewed-by Israel Rukshin <[email protected]>Signed-off-by Max Gurtovoy <[email protected]>--- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines
drivers/infiniband/ulp/isert/ib_isert.c isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain) · line 1994
Quoted 10 lines
drivers/infiniband/ulp/isert/ib_isert.c +1
-1@@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)if (se_cmd->prot_type ==TARGET_DIF_TYPE1_PROT || se_cmd->prot_type ==TARGET_DIF_TYPE2_PROT ) domain->sig.dif.ref_remap = true; -}; +}The same goes for
iser_set_dif_domain()andiser_cleanup_handler().
Good catch, I'll send iSER fixes in different series.
This series is for minor fixes for iSERT.
Quoted 8 lines
Thanks
Quoted 5 lines
drivers/infiniband/ulp/isert/ib_isert.c +0
-1static int isert_set_sig_attrs (struct se_cmd *se_cmd,struct ib_sig_attrs *sig_attrs) --2.25.4
Re: [PATCH 2/3] IB/isert: remove unneeded semicolon
In reply to Max GurtovoyPATCH 3/3 IB/isert: simplify signature cap check
In reply to Max GurtovoyUse if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
--- drivers/infiniband/ulp/isert/ib_isert.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +4 -2
@@ -230,8 +230,10 @@ isert_create_device_ib_res(struct isert_device *device) }/* Check signature cap */ - device->pi_capable = ib_dev->attrs.device_cap_flags & -IB_DEVICE_INTEGRITY_HANDOVER ? true : false; +if (ib_dev->attrs.device_cap_flags &IB_DEVICE_INTEGRITY_HANDOVER ) + device->pi_capable = true; +else + device->pi_capable = false;return 0 ; }
Signature · 1 line
2.25.4
Re: [PATCH 3/3] IB/isert: simplify signature cap check
Quoted 3 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Leon Romanovsky
maintainerRe: [PATCH 3/3] IB/isert: simplify signature cap check
Quoted 6 lines · Sagi Grimberg
Quoted 3 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Agree, probably even more cleaner variant will be:
device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);
Thanks
Jason Gunthorpe
maintainerRe: [PATCH 3/3] IB/isert: simplify signature cap check
Quoted 10 lines · Leon Romanovsky
Quoted 6 lines · Sagi Grimberg
Quoted 3 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Agree, probably even more cleaner variant will be:
device->pi_capable= !!(ib_dev->attrs.device_cap_flags &IB_DEVICE_INTEGRITY_HANDOVER);
Gah, !! is rarely a sign of something good..
Jason
Re: [PATCH 3/3] IB/isert: simplify signature cap check
Quoted 9 lines · Jason Gunthorpe
Quoted 7 lines · Leon Romanovsky
Quoted 4 lines · Sagi Grimberg
Quoted 2 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Agree, probably even more cleaner variant will be:
device->pi_capable= !!(ib_dev->attrs.device_cap_flags &IB_DEVICE_INTEGRITY_HANDOVER);Gah, !! is rarely a sign of something good..
can we take the series as-is ?
We have enough Acks and eyes on these minor cleanups.
Quoted 2 lines
Jason
Leon Romanovsky
maintainerRe: [PATCH 3/3] IB/isert: simplify signature cap check
Quoted 6 lines · Max Gurtovoy
Quoted 4 lines · Jason Gunthorpe
Quoted 3 lines · Leon Romanovsky
Quoted 2 lines · Sagi Grimberg
Quoted 2 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Agree, probably even more cleaner variant will be:
device->pi_capable= !!(ib_dev->attrs.device_cap_flags &IB_DEVICE_INTEGRITY_HANDOVER);Gah, !! is rarely a sign of something good..
can we take the series as-is ?
Of course :)
Thanks
Leon Romanovsky
maintainerRe: [PATCH 3/3] IB/isert: simplify signature cap check
In reply to Jason GunthorpeQuoted 6 lines · Jason Gunthorpe
Quoted 5 lines · Leon Romanovsky
Quoted 4 lines · Sagi Grimberg
Quoted 3 lines
Use if/else clause instead of "condition ? val1 : val2" to make the code cleaner and simpler.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Not sure what is cleaner and simpler for a simple condition, but I don't mind either way...
Agree, probably even more cleaner variant will be:
device->pi_capable= !!(ib_dev->attrs.device_cap_flags &IB_DEVICE_INTEGRITY_HANDOVER);Gah, !! is rarely a sign of something good..
You see, three of us see same code differently.
Quoted 2 lines
Jason
Jason Gunthorpe
maintainerQuoted 8 lines · Max Gurtovoy
The Linux convention is to have only 1 new line between functions.
Reviewed-by Israel Rukshin <[email protected]>Signed-off-by Max Gurtovoy <[email protected]>Reviewed-by Sagi Grimberg <[email protected]>--- drivers/infiniband/ulp/isert/ib_isert.c | 2 -- 1 file changed, 2 deletions(-)
Series applied to for-next, thanks
Jason