Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932273AbdCILwY (ORCPT ); Thu, 9 Mar 2017 06:52:24 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:21667 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754623AbdCILvw (ORCPT ); Thu, 9 Mar 2017 06:51:52 -0500 Date: Thu, 9 Mar 2017 13:50:16 +0200 From: Yuval Shaia To: SF Markus Elfring Cc: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 25/26] IB/ocrdma: Delete unnecessary braces Message-ID: <20170309115016.GF3307@yuval-lap> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3864 Lines: 117 On Wed, Mar 08, 2017 at 02:32:15PM +0100, SF Markus Elfring wrote: > 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 > --- > 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) > -- Reviewed-by: Yuval Shaia > 2.12.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html