From patchwork Sat Dec 26 18:43:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7922191 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B8459F32E for ; Sat, 26 Dec 2015 18:44:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 429B320320 for ; Sat, 26 Dec 2015 18:44:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69E6B20306 for ; Sat, 26 Dec 2015 18:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbbLZSoK (ORCPT ); Sat, 26 Dec 2015 13:44:10 -0500 Received: from mout.web.de ([212.227.15.4]:57115 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbbLZSoJ (ORCPT ); Sat, 26 Dec 2015 13:44:09 -0500 Received: from [192.168.1.2] ([78.53.181.98]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Lmchn-1algH12bb9-00aFAc; Sat, 26 Dec 2015 19:43:56 +0100 Subject: [PATCH 1/6] InfiniBand-ocrdma: One variable and jump label less in ocrdma_alloc_ucontext_pd() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Mitesh Ahuja , Sean Hefty , Selvin Xavier References: <566ABCD9.1060404@users.sourceforge.net> <567EDED5.4040201@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <567EDFDF.5000801@users.sourceforge.net> Date: Sat, 26 Dec 2015 19:43:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <567EDED5.4040201@users.sourceforge.net> X-Provags-ID: V03:K0:VU0SMZXURI5pCGtb0h4pGJmXEpgjB8R/eiRNTFsMjJYOA5L6lM2 QvSuLKUF3/tNps8rY60nT0ATOhGNLe359QZekRfKp+87TvG5SLnMPDmo95iQLfNNylpastx 6gP9lEHqkzI+J8CUZiQYLk25CNqcWPwTlmX/0hcfYoTAlXrdiVJ7DY7zTDHXDfpuc2cGRRU Yw7rMqXu9ruhOvB6miIDQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:zzVPknWr4TU=:OD/gkUwL93LJbCvQiSHpte 2zehmpCxZgPfIyZSCL1w7iD82nVYj7Et7YI8FTVw5fQyPcygnpW4mmTqGeKrqbXmxDaJv5Tr1 us+d1Le3wog1VETIEledoY3q38gV2TFNpn/1QcrIs+dfmhE61jA9574q0xiUukdEcJiwy5ckx AO3Jf2hWnLS0+m+Qp4C8r6vma9xfB08DIpP+g1RJzLGQ6PYiHDTRWoICy+s+6+jLPTS2Wq1L0 e+5Hq6v+5vPdqEPY24KnkA/80w6OmDdMjCNijhE+a7un2oaSYjvFppyccMrChBpRlGeMLd4Dd /4/4cbtg2wAnebsx7ue5sA67oqUDuMRslC8VM4E4Ddw1K9Yc1KkYWeNrJzAv1huHZLEkzo/Ys qL5Uu84PO6EJD8InS6ovfkPxuB4bq+5nM1+Ou42jrUWq96/bDZH0+8oc8tOmuhUyFbpvcomUc BPFDamNq/To1xfeyzIaT1+j9yl5FZxWEyPSe885WU6+WmSZ1qH8O6OVFcU+N6Fqwzpjbmqch0 5ZXQ+9ai9p2s4lOa3ss4i/SFs0tTT0FjtejeuafF5hqyK93fxX0rng/WJHV7xJQ10FduHn/zC ubCjvt8cV4pGjS3dNrXHR3LBoMZNWGyLsBESthyIE8gheJWGD4MwnIWt21YFVsa/+9HW/L1Wz b1z9y3ITsmTLgvumN+XBZpfq1yL0aOPd4zUBxnB6KioZwACYC1QqXkHvaKgtte8BSaQyt/lwC H7ZRcm/uYEhRr/i4WJCnIQJov6p+2B+Mj09xkztPPt2WryXRQaG8UIeqkeNywY2dypgcDSD2u 4JSHS43 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 26 Dec 2015 17:16:00 +0100 This issue was detected by using the Coccinelle software. * Let us return directly if a call of the _ocrdma_alloc_pd() function failed. * Delete the jump label "err" and the local variable "status" then. Signed-off-by: Markus Elfring --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 583001b..374c839 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -483,19 +483,15 @@ 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); uctx->cntxt_pd = NULL; - goto err; + return PTR_ERR(uctx->cntxt_pd); } 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)