diff mbox

[v2] IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey

Message ID 20171107144517.GA25631@embeddedor.com (mailing list archive)
State Accepted
Headers show

Commit Message

Gustavo A. R. Silva Nov. 7, 2017, 2:45 p.m. UTC
Check on return value and goto label mbx_err are unnecessary.

Addresses-Coverity-ID: 1268780
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
---
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(-)

Comments

Gustavo A. R. Silva Nov. 7, 2017, 2:56 p.m. UTC | #1
Quoting Leon Romanovsky <leon@kernel.org>:

> On Tue, Nov 07, 2017 at 08:45:17AM -0600, Gustavo A. R. Silva wrote:
>> Check on return value and goto label mbx_err are unnecessary.
>>
>> Addresses-Coverity-ID: 1268780
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
>> ---
>> 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.
>

I'm using mutt.
What would be the advantage of using git send-email in this case?

> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

Thank you
--
Gustavo A. R. Silva





--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Nov. 7, 2017, 4:28 p.m. UTC | #2
On Tue, Nov 07, 2017 at 08:56:37AM -0600, Gustavo A. R. Silva wrote:
>
> Quoting Leon Romanovsky <leon@kernel.org>:
>
> > On Tue, Nov 07, 2017 at 08:45:17AM -0600, Gustavo A. R. Silva wrote:
> > > Check on return value and goto label mbx_err are unnecessary.
> > >
> > > Addresses-Coverity-ID: 1268780
> > > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> > > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> > > ---
> > > 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.
> >
>
> 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.

>
> > Thanks,
> > Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
>
> Thank you
> --
> Gustavo A. R. Silva
>
>
>
>
>
Gustavo A. R. Silva Nov. 8, 2017, 8:16 p.m. UTC | #3
Quoting Leon Romanovsky <leon@kernel.org>:

> On Tue, Nov 07, 2017 at 08:56:37AM -0600, Gustavo A. R. Silva wrote:
>>
>> Quoting Leon Romanovsky <leon@kernel.org>:
>>
>> > On Tue, Nov 07, 2017 at 08:45:17AM -0600, Gustavo A. R. Silva wrote:
>> > > Check on return value and goto label mbx_err are unnecessary.
>> > >
>> > > Addresses-Coverity-ID: 1268780
>> > > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> > > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
>> > > ---
>> > > 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.
>> >
>>
>> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Nov. 9, 2017, 8:28 a.m. UTC | #4
On Wed, Nov 08, 2017 at 02:16:25PM -0600, Gustavo A. R. Silva wrote:
>
> Quoting Leon Romanovsky <leon@kernel.org>:
>
> > On Tue, Nov 07, 2017 at 08:56:37AM -0600, Gustavo A. R. Silva wrote:
> > >
> > > Quoting Leon Romanovsky <leon@kernel.org>:
> > >
> > > > On Tue, Nov 07, 2017 at 08:45:17AM -0600, Gustavo A. R. Silva wrote:
> > > > > Check on return value and goto label mbx_err are unnecessary.
> > > > >
> > > > > Addresses-Coverity-ID: 1268780
> > > > > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> > > > > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> > > > > ---
> > > > > 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.
> > > >
> > >
> > > 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?

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

>
> Thanks
> --
> Gustavo A. R. Silva
>
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Nov. 13, 2017, 9:19 p.m. UTC | #5
On Tue, 2017-11-07 at 08:45 -0600, Gustavo A. R. Silva wrote:
> Check on return value and goto label mbx_err are unnecessary.
> 
> Addresses-Coverity-ID: 1268780
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index f8c14c7..0ba695a 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -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;
 }