From patchwork Sat Apr 22 14:51:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9694435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6376860383 for ; Sat, 22 Apr 2017 14:54:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66F8327EED for ; Sat, 22 Apr 2017 14:54:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BD6F28409; Sat, 22 Apr 2017 14:54:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2D3B27EED for ; Sat, 22 Apr 2017 14:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424804AbdDVOwS (ORCPT ); Sat, 22 Apr 2017 10:52:18 -0400 Received: from mout.web.de ([212.227.15.4]:57080 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424693AbdDVOwH (ORCPT ); Sat, 22 Apr 2017 10:52:07 -0400 Received: from [192.168.1.2] ([77.181.100.232]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M3PN2-1cBDJI0kOu-00r0sC; Sat, 22 Apr 2017 16:51:52 +0200 Subject: [PATCH v2 11/12] IB/ocrdma: Delete an unnecessary variable in ocrdma_dealloc_pd() From: SF Markus Elfring To: Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , Yuval Shaia , linux-rdma@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org References: <1492720999.3041.18.camel@redhat.com> <86425035-7da8-d2b1-8544-d4f7540d50c6@users.sourceforge.net> Message-ID: <723017f3-4a6e-5f4d-5431-4caf8af90c2d@users.sourceforge.net> Date: Sat, 22 Apr 2017 16:51:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <86425035-7da8-d2b1-8544-d4f7540d50c6@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:DlraYKsidlcdW2aOKU4T+Mw3mkOgzp80PZ67cOkNVj8jfpymmXn rxNJgKavtZaT9+M4LMvrVIiZByUXGyjUicggY/0lnDoVR4o+IuJNAUwlzrspv2VW7EHHRpG gmD5U6FEm5Kr9yE35NuLf35oSY0/r7SGFK//vWGvv5DP9ubj0M0ffPBnB3GPw4eOtICMZ86 qimEeEiKzqPp3g3m95C1w== X-UI-Out-Filterresults: notjunk:1; V01:K0:Axi+t3RWTYI=:XVVzUKAO3s4wYIrkVb3x67 E0xFnaLg4uriAFm83ef4CHl0hfVal5IoqR2Z2J4MWy06igw9hRuB3c4vhRhkioR1Hwx6RqMFY 3vG1G56CuwwsuKazsHVq+06iHbOK6XkWf8LpUaTfnREQ3+gVrYhnKTty231dllUB+OXfKu8TN jbPOmDev6p/rHw/c5T+GqAcGSt6lmuVMORy0cu2dLx4DOeNtin9mrgn58CgoApTR1P4LulJGl maTToqZJ5I7VXOOL1h/wcQVjuGsZEDQF1PB6AuTiYX8Nrfb9jBlhcATVP++v25kaFSXwWyaLw WsBsTZhp2Nh904FjtqWQxKWSWHvp19bVZKx9J1GyVEILUgwDoBhEmNZ6CDlrGdafCHTlqcTAr z3p6ZPdrON3I4zK1MaulBiStmsJGhYxUVMdWrD54wfd+IRNySSInNngAhcRLlIZmA8IVmTSbE GBIQ7YpDfZtyfmo1ZF8UMSFDG3ACAS7CoZlHjdq6bggF0OBhBScoYQSa/wPjDAedGxRdjIufK c5k9JtOpn+gMgQxzKl4/c3Fzt1AWgoREUkRWBGAuRwvmcA0B0XqfUWgcVQJo8Te87jVKw2Jw9 qA6Os5o2IISA3uWjBJZA276jx7CxgxSGp7ocEjk6ncfjRC8gKRK+SezSOXaIioaFTvjAJr+xv sBVD7/Dow4jaMS60suw2aBnFJLVx0oIQoTB6SVs6AXfjMeMrL4QrmCtHRp9dQebmgNJ3T6zSe UXmQZXhpLy2LF5kYEbOcEj/WEorWp751ngV0MhqYUZWih7pCBdxml2Gn4GAhvBCGC9AVIbxYj uWsurP+ Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 22 Apr 2017 15:32:05 +0200 1. Return zero in one case directly. 2. Return the value from a call of the function "_ocrdma_dealloc_pd" without using an extra assignment for the local variable. 3. Remove the variable "status" in this function then. Signed-off-by: Markus Elfring Acked-by: Devesh Sharma Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 60b8813aff42..712c0dc9c980 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -754,7 +754,6 @@ int ocrdma_dealloc_pd(struct ib_pd *ibpd) struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); struct ocrdma_ucontext *uctx = NULL; - int status = 0; u64 usr_db; uctx = pd->uctx; @@ -768,11 +767,10 @@ int ocrdma_dealloc_pd(struct ib_pd *ibpd) if (is_ucontext_pd(uctx, pd)) { ocrdma_release_ucontext_pd(uctx); - return status; + return 0; } } - status = _ocrdma_dealloc_pd(dev, pd); - return status; + return _ocrdma_dealloc_pd(dev, pd); } static int ocrdma_alloc_lkey(struct ocrdma_dev *dev, struct ocrdma_mr *mr,