IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey
Subsystems (2)
PATCH 1/1 IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey
Check on return value and goto label mbx_err are unnecessary.
Addresses-Coverity-ID: 1268780
--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1 -3
@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +kfree (cmd);return status; }
Signature · 1 line
2.7.4
Quoted 3 lines · Gustavo A. R. Silva
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
What's that?
Quoted 10 lines
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-0
drivers/infiniband/hw/ocrdma/ocrdma_hw.c int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) · line 1961
Quoted 9 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1
-3@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +kfree (cmd);return status;
Quoted 8 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-0}Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Yuval,
Quoting Yuval Shaia <[email protected]>:
Quoted 7 lines · Gustavo A. R. Silva
Quoted 3 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
What's that?
Coverity is a static code analyzer.
I am fixing Coverity issues and that is the ID Coverity assigned to this particular issue.
Quoted 13 lines
Quoted 13 lines
--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-0@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd);
Quoted 9 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) · line 1961
Quoted 6 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1
-3-if (status) - goto mbx_err; -mbx_err: +kfree (cmd);return status;Reviewed-by Yuval Shaia <[email protected]>
Thank you
--
Gustavo A. R. Silva
Quoted 13 lines · Gustavo A. R. Silva
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-0
drivers/infiniband/hw/ocrdma/ocrdma_hw.c int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) · line 1959
Quoted 7 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1
-3@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +
Can you please remove assignment from "int status = -ENOMEM"? It produces warning too.
Thanks
Quoted 6 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-1kfree (cmd);return status; } --2.7.4
Hi Leon,
Quoting Leon Romanovsky <[email protected]>:
Quoted 9 lines · Gustavo A. R. Silva
Quoted 8 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 17 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev · line 1960
Quoted 13 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1
-3@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +Can you please remove assignment from "int status =
-ENOMEM"? It produces warning too.
OK. Will do.
By the way, which compiler triggers that warning?
I'm using GCC 7.2.0 and I don't see it.
Thanks
--
Gustavo A. R. Silva
Quoted 32 lines · Gustavo A. R. Silva
Hi Leon,
Quoting Leon Romanovsky <[email protected]>:
Quoted 18 lines · Gustavo A. R. Silva
Quoted 17 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/infiniband/hw/ocrdma/ocrdma_hw.c +0
-0@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ;Quoted 9 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) · line 1959
Quoted 5 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1
-3status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +Can you please remove assignment from "int status =
-ENOMEM"? It produces warning too.
Quoted 3 lines
OK. Will do.
By the way, which compiler triggers that warning?
Honestly, I don't remember, one of my building bots complained about it.
Thanks
Quoted 11 lines
I'm using GCC 7.2.0 and I don't see it.
Thanks
--
Gustavo A. R. Silva
PATCH v2 1/1 IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey
In reply to Gustavo A. R. SilvaCheck on return value and goto label mbx_err are unnecessary.
Addresses-Coverity-ID: 1268780
---
Changes in v2:
Remove assignment from "int status = -ENOMEM" as suggested by Leon Romanovsky.
drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +2 -4
@@ -1947,7 +1947,7 @@ int ocrdma_mbx_alloc_lkey(struct ocrdma_dev *dev, struct ocrdma_hw_mr *hwmr,int ocrdma_mbx_dealloc_lkey (struct ocrdma_dev *dev,int fr_mr,u32 lkey) { -int status = -ENOMEM ; +int status;struct ocrdma_dealloc_lkey *cmd; cmd =ocrdma_init_emb_mqe (OCRDMA_CMD_DEALLOC_LKEY ,sizeof (*cmd));
@@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey) cmd->lkey = lkey; cmd->rsvd_frmr = fr_mr ?1 :0 ; status =ocrdma_mbx_cmd (dev, (struct ocrdma_mqe *)cmd); -if (status) - goto mbx_err; -mbx_err: +kfree (cmd);return status; }
Signature · 1 line
2.7.4
Quoted 11 lines · Gustavo A. R. Silva
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Yuval Shaia <[email protected]>---
Changes in v2:
Remove assignment from "int status =-ENOMEM" as suggested by Leon Romanovsky.drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Please use git send-email to send patches and not reply to the conversation.
Thanks,
Quoting Leon Romanovsky <[email protected]>:
Quoted 11 lines · Gustavo A. R. Silva
Quoted 10 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Yuval Shaia <[email protected]>---
Changes in v2:
Remove assignment from "int status =-ENOMEM" as suggested by Leon
Romanovsky.
Quoted 5 lines
Quoted 2 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Please use git send-email to send patches and not reply to the conversation.
I'm using mutt.
What would be the advantage of using git send-email in this case?
Quoted 2 lines
Thanks,
Reviewed-by Leon Romanovsky <[email protected]>
Thank you
--
Gustavo A. R. Silva
Quoted 14 lines · Gustavo A. R. Silva
Quoting Leon Romanovsky <[email protected]>:
Quoted 11 lines · Gustavo A. R. Silva
Quoted 10 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>Reviewed-by Yuval Shaia <[email protected]>---
Changes in v2:
Remove assignment from "int status =-ENOMEM" as suggested by Leon
Romanovsky.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Please use git send-email to send patches and not reply to the conversation.
I'm using mutt.
What would be the advantage of using git send-email in this case?
New mail headers, so it won't appear as Reply-To and will be presented correctly in mutt's threaded mode.
You can do it with mutt too.
Quoted 12 lines
Quoted 3 lines
Thanks,
Thank you
--
Gustavo A. R. Silva
Quoting Leon Romanovsky <[email protected]>:
Quoted 19 lines · Gustavo A. R. Silva
Quoted 18 lines
Quoting Leon Romanovsky <[email protected]>:
Quoted 15 lines · Gustavo A. R. Silva
Quoted 5 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>Reviewed-by Yuval Shaia <[email protected]>Quoted 7 lines
---
Changes in v2:
Remove assignment from "int status =-ENOMEM" as suggested by Leon
Romanovsky.drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Please use git send-email to send patches and not reply to the
Quoted 9 lines
Quoted 5 lines
conversation.
Quoted 1 line
I'm using mutt.
What would be the advantage of using git send-email in this case?New mail headers, so it won't appear as Reply-To and will be presented correctly in mutt's threaded mode.
Oh I actually did that on purpose.
So the preferred way to do this is to send the vN of the patch as a reply to the first patch? or as a new thread?
Thanks
--
Gustavo A. R. Silva
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 32 lines · Gustavo A. R. Silva
Quoting Leon Romanovsky <[email protected]>:
Quoted 19 lines · Gustavo A. R. Silva
Quoted 18 lines
Quoting Leon Romanovsky <[email protected]>:
Quoted 15 lines · Gustavo A. R. Silva
Quoted 5 lines
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Yuval Shaia <[email protected]>Quoted 7 lines
---
Changes in v2:
Remove assignment from "int status =-ENOMEM" as suggested by Leon
Romanovsky.drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Please use git send-email to send patches and not reply to the
Quoted 9 lines
Quoted 5 lines
conversation.
Quoted 1 line
I'm using mutt.
What would be the advantage of using git send-email in this case?New mail headers, so it won't appear as Reply-To and will be presented correctly in mutt's threaded mode.
Quoted 5 lines
Oh I actually did that on purpose.
So the preferred way to do this is to send the vN of the patch as a reply to the first patch?
or as a new thread?
As a new thread, please. It gives numerous advantages: nice view in mutt, easy followed links in web archives and maintainer's acceptance email as a response to actual vN patch and not to initial patch.
Thanks
Quoted 13 lines
Thanks
--
Gustavo A. R. Silva--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Doug Ledford
AppliedQuoted 5 lines · Gustavo A. R. Silva
Check on return value and goto label
mbx_errare unnecessary.Addresses-Coverity-ID: 1268780
Signed-off-by Gustavo A. R. Silva <garsilva-L1vi/[email protected]>Reviewed-by Yuval Shaia <[email protected]>
Thanks, applied.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD