Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306178

Re: [PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in ocrdma_alloc_ucontext_pd()

From Selvin Xavier <selvin.xavier@avagotech.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in ocrdma_alloc_ucontext_pd()
Date 2016-01-11 14:20 +0100
Message-ID <qPKy6-2SK-19@gated-at.bofh.it> (permalink)
References <qK30J-54I-3@gated-at.bofh.it> <qK4zv-6bw-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch series looks good to me

Thanks,

Acked-by: Selvin Xavier <selvin.xavier@avagotech.com>



On Sun, Dec 27, 2015 at 2:58 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 26 Dec 2015 22:18:38 +0100
>
> This issue was detected by using the Coccinelle software.
>
> * Let us return directly if a call of the _ocrdma_alloc_pd()
>   function failed.
>
> * Reduce the scope for the local variable "status" to one case
>   of an if statement.
>
> * Delete the jump label "err" then.
>
> * Return zero as a constant at the end.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index 583001b..7f10cc47 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -483,19 +483,16 @@ 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.6.3
>

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in ocrdma_alloc_ucontext_pd() Selvin Xavier <selvin.xavier@avagotech.com> - 2016-01-11 14:20 +0100

csiph-web