From patchwork Wed Mar 8 13:32:15 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: 9611157 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 7D0AF60414 for ; Wed, 8 Mar 2017 13:44:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 308622858D for ; Wed, 8 Mar 2017 13:44:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2549C28593; Wed, 8 Mar 2017 13:44:28 +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=unavailable 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 CBE752858D for ; Wed, 8 Mar 2017 13:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdCHNoK (ORCPT ); Wed, 8 Mar 2017 08:44:10 -0500 Received: from mout.web.de ([212.227.15.3]:54720 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752861AbdCHNoI (ORCPT ); Wed, 8 Mar 2017 08:44:08 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M5wkL-1c1uo53kPh-00xoUV; Wed, 08 Mar 2017 14:32:17 +0100 Subject: [PATCH 25/26] IB/ocrdma: Delete unnecessary braces To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Wed, 8 Mar 2017 14:32:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:tGGvwXwzPY2oNX9sVnxgeArFq9tSiE8Ybq5By4WTQCzNPq8+wfW LVMRU3fz8nAZjFFvPg0YLhaKynkQFl7Oj/C6mMQwNXhg457rApmjqOa2wrarS2s0LUC0FDF ueJgz2iLZUjHfl2n89xz6FT4D75ynOQWjAYAP7XXFEjw97OHTHqlAVfUj6tReI2lI5xmwmY LV5dRmcRK5fvtZMspIx7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:voYLOd/9aXw=:84ompBp+tE8F+Y3A0FctEx 2J0QJbaMJ4TnP7i23oXUJb/yGZy1MJg1tfT/yTZKByGwLVbJkIDFzzrHuH3fTzl91bJlRWFcG gu9IO8fwfwJEvwCj27hXbu+li8cowRu07ObaEvsLhVPVrlD2rz4IbLQztH+7URKmfQyq22tbf uFWQYTTOSuOI491DIdzYcBNG4erdYgHLYTnZ//Dw1PtiCAsmPQmyPSzMiSjeLI9qqdB81R+4y kzjeqpDRYWlJmvdDD/pVMqZ62bcMEeQB9hOxMwqamPCeTEAsj7qKp4u3STIEAU1ktCsAmpVeZ cPW4A6ibdz7qz4PxlxAajXfMJSwj6UJRCoyDdG54sPMpArqKoTn0dw3PqcogdqGz354MkOn8j vq/SOlzsWM2pW8w4xwjY1US/AZQ0/qh/cMre1Bn3sKtSGqmEkpi5bQ73JitFuQvooOEWjSBX3 6x4TRwH3PQRa+t/YNxeQRsS7oHghqDMxJkOvJqzcvEAni/hoT0EC9jqTd99ZKQ+2jXrx7qZbT HND53gvLgy/Qq0PPOtALhFAePXjEQZ33cqWzcF/eQb1owDeURBo56QjmlcI642KiAjdJr1ZHX JE3RQOyOzk0l/ZN/yA/BHfNbdDin3KzM46qbEu+lBtsJSnMZA4+iQ+wTLBvmoH9j6qacurULV jfsrteswC5aCulbjdozDkF93qyedkyk1rpikOqnJgT0hj+yk5muV8d4kql56ExtqxpjPEpHxv /7Pw2c1wk5Wx6pnv+u8vGo2ojvOI7C9JHF9xrTkf5xDnh2xdp8gRWKYC2aoHrLG5v+mVkhlta fhpIv4m 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: Wed, 8 Mar 2017 12:36:41 +0100 Do not use curly brackets at some source code places where a single statement should be sufficient. Signed-off-by: Markus Elfring Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 41 +++++++++++------------------ 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index d3cb8e2f099f..bfd86fd08847 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -502,10 +502,10 @@ static int ocrdma_dealloc_ucontext_pd(struct ocrdma_ucontext *uctx) struct ocrdma_pd *pd = uctx->cntxt_pd; struct ocrdma_dev *dev = get_ocrdma_dev(pd->ibpd.device); - if (uctx->pd_in_use) { + if (uctx->pd_in_use) pr_err("%s(%d) Freeing in use pdid=0x%x.\n", __func__, dev->id, pd->id); - } + uctx->cntxt_pd = NULL; (void)_ocrdma_dealloc_pd(dev, pd); return 0; @@ -739,11 +739,10 @@ struct ib_pd *ocrdma_alloc_pd(struct ib_device *ibdev, return &pd->ibpd; err: - if (is_uctx_pd) { + if (is_uctx_pd) ocrdma_release_ucontext_pd(uctx); - } else { + else status = _ocrdma_dealloc_pd(dev, pd); - } exit: return ERR_PTR(status); } @@ -1018,10 +1017,10 @@ int ocrdma_dereg_mr(struct ib_mr *ib_mr) kfree(mr); /* Don't stop cleanup, in case FW is unresponsive */ - if (dev->mqe_ctx.fw_error_state) { + if (dev->mqe_ctx.fw_error_state) pr_err("%s(%d) fw not responding.\n", __func__, dev->id); - } + return 0; } @@ -1410,10 +1409,10 @@ struct ib_qp *ocrdma_create_qp(struct ib_pd *ibpd, goto gen_err; memset(&ureq, 0, sizeof(ureq)); - if (udata) { + if (udata) if (ib_copy_from_udata(&ureq, udata, sizeof(ureq))) return ERR_PTR(-EFAULT); - } + qp = kzalloc(sizeof(*qp), GFP_KERNEL); if (!qp) { status = -ENOMEM; @@ -2829,15 +2828,11 @@ static bool ocrdma_poll_rcqe(struct ocrdma_qp *qp, struct ocrdma_cqe *cqe, bool expand = false; ibwc->wc_flags = 0; - if (qp->qp_type == IB_QPT_UD || qp->qp_type == IB_QPT_GSI) { - status = (le32_to_cpu(cqe->flags_status_srcqpn) & - OCRDMA_CQE_UD_STATUS_MASK) >> - OCRDMA_CQE_UD_STATUS_SHIFT; - } else { - status = (le32_to_cpu(cqe->flags_status_srcqpn) & - OCRDMA_CQE_STATUS_MASK) >> OCRDMA_CQE_STATUS_SHIFT; - } - + status = (qp->qp_type == IB_QPT_UD || qp->qp_type == IB_QPT_GSI) + ? ((le32_to_cpu(cqe->flags_status_srcqpn) & + OCRDMA_CQE_UD_STATUS_MASK) >> OCRDMA_CQE_UD_STATUS_SHIFT) + : ((le32_to_cpu(cqe->flags_status_srcqpn) & + OCRDMA_CQE_STATUS_MASK) >> OCRDMA_CQE_STATUS_SHIFT); if (status == OCRDMA_CQE_SUCCESS) { *polled = true; ocrdma_poll_success_rcqe(qp, cqe, ibwc); @@ -2885,13 +2880,9 @@ static int ocrdma_poll_hwcq(struct ocrdma_cq *cq, int num_entries, qp = dev->qp_tbl[qpn]; BUG_ON(qp == NULL); - if (is_cqe_for_sq(cqe)) { - expand = ocrdma_poll_scqe(qp, cqe, ibwc, &polled, - &stop); - } else { - expand = ocrdma_poll_rcqe(qp, cqe, ibwc, &polled, - &stop); - } + expand = is_cqe_for_sq(cqe) + ? ocrdma_poll_scqe(qp, cqe, ibwc, &polled, &stop) + : ocrdma_poll_rcqe(qp, cqe, ibwc, &polled, &stop); if (expand) goto expand_cqe; if (stop)