[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANjDDBhWJrSfRTYeassC4pW3tVNe3c4X6VTJarRf5B3kw2D-RQ@mail.gmail.com>
Date: Wed, 8 Mar 2017 20:47:53 +0530
From: Devesh Sharma <devesh.sharma@...adcom.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc: linux-rdma <linux-rdma@...r.kernel.org>,
Devesh Sharma <devesh.sharma@...gotech.com>,
Doug Ledford <dledford@...hat.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Sean Hefty <sean.hefty@...el.com>,
Selvin Xavier <selvin.xavier@...gotech.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 24/26] IB/ocrdma: One jump label less in ocrdma_alloc_ucontext_pd()
Acked-By: Devesh Sharma <devesh.sharma@...adcom.com>
On Wed, Mar 8, 2017 at 7:00 PM, SF Markus Elfring
<elfring@...rs.sourceforge.net> wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 8 Mar 2017 11:11:35 +0100
>
> This issue was detected by using the Coccinelle software.
>
> 1. Return directly if a call of the function "_ocrdma_alloc_pd" failed.
>
> 2. Reduce the scope for the local variable "status" to one case
> of an if statement.
>
> 3. Delete the jump label "err" then.
>
> 4. Return zero as a constant at the end.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index ae0d343d1731..d3cb8e2f099f 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -484,19 +484,17 @@ static int ocrdma_alloc_ucontext_pd(struct ocrdma_dev *dev,
> struct ocrdma_ucontext *uctx,
> struct ib_udata *udata)
> {
> - int status = 0;
> -
> uctx->cntxt_pd = _ocrdma_alloc_pd(dev, uctx, udata);
> if (IS_ERR(uctx->cntxt_pd)) {
> - status = PTR_ERR(uctx->cntxt_pd);
> + int status = PTR_ERR(uctx->cntxt_pd);
> +
> uctx->cntxt_pd = NULL;
> - goto err;
> + return status;
> }
>
> uctx->cntxt_pd->uctx = uctx;
> uctx->cntxt_pd->ibpd.device = &dev->ibdev;
> -err:
> - return status;
> + return 0;
> }
>
> static int ocrdma_dealloc_ucontext_pd(struct ocrdma_ucontext *uctx)
> --
> 2.12.0
>
Powered by blists - more mailing lists