From patchwork Sat Dec 26 21:28:44 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: 7922371 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93B14BEEE5 for ; Sat, 26 Dec 2015 21:29:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99CEA2028D for ; Sat, 26 Dec 2015 21:29:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9FA020268 for ; Sat, 26 Dec 2015 21:29:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753241AbbLZV3J (ORCPT ); Sat, 26 Dec 2015 16:29:09 -0500 Received: from mout.web.de ([212.227.17.11]:62685 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbbLZV3G (ORCPT ); Sat, 26 Dec 2015 16:29:06 -0500 Received: from [192.168.1.2] ([78.53.181.98]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LyDlZ-1aGDhy3sXt-015bUe; Sat, 26 Dec 2015 22:28:48 +0100 Subject: [PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in ocrdma_alloc_ucontext_pd() References: <201512270304.PMbiMdOa%fengguang.wu@intel.com> Cc: kbuild-all@01.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Mitesh Ahuja , Sean Hefty , Selvin Xavier From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <567F068C.9060507@users.sourceforge.net> Date: Sat, 26 Dec 2015 22:28:44 +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: <201512270304.PMbiMdOa%fengguang.wu@intel.com> X-Provags-ID: V03:K0:nZsYzgLH1eEXPmU47dK66TEVk7ZjycwKRL9sSFhWIrfGVWz/j98 oa5AYYuiF0Yd3mFsHhnAT+yk/FJVL/A3wEMmiF6Z4gcGmur1a5tenZr+mfI5hs29AA9+v/R 7PO55jYPkK4V34hFNC5+MSVRabK5Im0mm3SdBN1SPLaio0B8tM/qUfUJuHmsW4qJ/R/2lLn TYq0Fk30nhNAcu4i6TIjA== X-UI-Out-Filterresults: notjunk:1; V01:K0:vrXNXdpWu+c=:tXL+vyqOyUtGQXmOXBG0sY EuG+gNLRq29o7UOajRmKLe9w2HeMUM2cMLNzQLjEwYKV5r0Tb4j4jVnIsl9kkxSJduvg0wktL o65kn0ULGkMiUqgpCluCmg0aqD69/14t+JH8lE/dLEBD45h8efQXwHcVv1twUsQr5IVh/snAi XkcGZobVc3TYG11kv7iX2cuHiApumtrQtydiXdy1xSLZF2bNT1CF1YBsSpaUih070/0u8lUbg hdv5eKpb7sRAi6VaeAVuJDrdg3XyGd7Ij9wttY0h4+raYMNsopeA8t7auF13EKmEc/wuLJG1j XJ42n05o4LxgjSGfxKIFGpf2EeYssx0/y7TVDlDbZhqqFxQGaGd/293hzheIamYcH8Y6g8Mqq bVUNpOAWF2FRh7jYP1ZWhRo3nHJjULqZ8fwYWU4zGtWrIC/bQGRzEN49t1OCqlhprp7pHg+eo 4++2ZfdGm7OBO4b91/ovPmVyLjLPcbJehQmQIqVAul9JpAzuWC87vTZYBYXbhbxNJX1N7f6xA KDXJhcJ0mW//km6Oui4KLNHm8ZkKYm3AQKmo26JAk6KMvWL5sRvP2P7B9NSaaJZIuBb+JK+3U j8tRDavy9Hsl5vkZ91tlzH1HX+lI67lw0o5/iywvpZhkF5QQd87Vr54r555b6KqViN54G7UHU PNHzp0uaDgTuDJFsIzdwaXiwprXB3OCF6Cr4S9W/q8MWMBcXYP1oyviRVb/pJc9o9IMY6nC4D 6rCdjFzymbpELkFoi15XepINvS84aSkfVSQugobj2zjNaUzCS8uPG+AdOhW3N6QPcmXBkg7aG 7eoXQW0 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 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 Acked-by: Selvin Xavier --- 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)