From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Devesh Sharma <devesh.sharma@avagotech.com>,
Doug Ledford <dledford@redhat.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
Sean Hefty <sean.hefty@intel.com>,
Selvin Xavier <selvin.xavier@avagotech.com>,
Yuval Shaia <yuval.shaia@oracle.com>,
linux-rdma@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH v2 12/12] IB/ocrdma: One jump label less in ocrdma_alloc_ucontext_pd()
Date: Sat, 22 Apr 2017 16:54:18 +0200 [thread overview]
Message-ID: <d6fbc9e2-aaee-3c1f-e5b5-d7c09774557d@users.sourceforge.net> (raw)
In-Reply-To: <86425035-7da8-d2b1-8544-d4f7540d50c6@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 22 Apr 2017 15:45:21 +0200
This issue was detected by using the Coccinelle software.
1. Return directly if a call of the function "_ocrdma_alloc_pd" failed.
2. Reduce the scope for the local variable "status" to one case
of an if statement.
3. Delete the jump label "err" then.
4. Return zero as a constant at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Devesh Sharma <devesh.sharma@broadcom.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
---
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 712c0dc9c980..fbceb9d9d5b0 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -484,19 +484,17 @@ 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)
--
2.12.2
prev parent reply other threads:[~2017-04-22 14:56 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fc421509-4069-da8a-b308-60b49ea91ada@users.sourceforge.net>
2017-03-08 12:36 ` [PATCH 01/26] IB/ocrdma: Use kcalloc() in ocrdma_create_eqs() SF Markus Elfring
2017-03-08 12:41 ` [PATCH 02/26] IB/ocrdma: Use kcalloc() in ocrdma_mbx_alloc_pd_range() SF Markus Elfring
2017-03-08 14:03 ` Yuval Shaia
2017-04-20 20:40 ` Doug Ledford
2017-03-08 12:45 ` [PATCH 03/26] IB/ocrdma: Improve size determinations in ocrdma_mbx_get_dcbx_config() SF Markus Elfring
2017-03-08 13:54 ` Yuval Shaia
2017-03-08 14:46 ` Devesh Sharma
2017-03-08 12:48 ` [PATCH 04/26] IB/ocrdma: Delete unnecessary variable initialisations " SF Markus Elfring
2017-03-08 14:06 ` Yuval Shaia
2017-03-08 12:50 ` [PATCH 05/26] IB/ocrdma: Improve another size determination in ocrdma_mbx_query_qp() SF Markus Elfring
2017-03-08 14:07 ` Yuval Shaia
2017-03-08 12:53 ` [PATCH 06/26] IB/ocrdma: Improve another size determination in ocrdma_alloc_pd_pool() SF Markus Elfring
2017-03-08 12:55 ` [PATCH 07/26] IB/ocrdma: Improve another size determination in ocrdma_mbx_get_ctrl_attribs() SF Markus Elfring
2017-03-08 14:08 ` Yuval Shaia
2017-03-08 12:58 ` [PATCH 08/26] IB/ocrdma: Improve size determinations in ocrdma_mbx_rdma_stats() SF Markus Elfring
2017-03-08 14:20 ` Yuval Shaia
2017-03-08 13:00 ` [PATCH 09/26] IB/ocrdma: Improve another size determination in ocrdma_mq_cq_handler() SF Markus Elfring
2017-03-08 14:22 ` Yuval Shaia
2017-03-08 13:02 ` [PATCH 10/26] IB/ocrdma: Improve another size determination in ocrdma_init_emb_mqe() SF Markus Elfring
2017-03-08 14:22 ` Yuval Shaia
2017-03-08 14:42 ` Devesh Sharma
2017-03-08 13:04 ` [PATCH 11/26] IB/ocrdma: Delete unnecessary braces SF Markus Elfring
2017-03-08 14:24 ` Yuval Shaia
2017-03-08 14:59 ` Devesh Sharma
2017-03-08 13:07 ` [PATCH 12/26] IB/ocrdma: Adjust ten checks for null pointers SF Markus Elfring
2017-03-08 14:27 ` Yuval Shaia
2017-03-08 13:09 ` [PATCH 13/26] IB/ocrdma: Use kcalloc() in ocrdma_alloc_resources() SF Markus Elfring
2017-03-08 13:10 ` [PATCH 14/26] IB/ocrdma: Improve another size determination in ocrdma_add() SF Markus Elfring
2017-03-08 14:27 ` Yuval Shaia
2017-03-08 13:13 ` [PATCH 15/26] IB/ocrdma: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-03-08 15:03 ` Devesh Sharma
2017-03-08 15:26 ` Yuval Shaia
2017-03-08 13:15 ` [PATCH 16/26] IB/ocrdma: Adjust a null pointer check in ocrdma_alloc_resources() SF Markus Elfring
2017-03-08 15:03 ` Devesh Sharma
2017-03-09 11:42 ` Yuval Shaia
2017-03-08 13:17 ` [PATCH 17/26] IB/ocrdma: Use kmalloc_array() in ocrdma_create_srq() SF Markus Elfring
2017-03-08 15:05 ` Devesh Sharma
2017-03-08 13:19 ` [PATCH 18/26] IB/ocrdma: Use kcalloc() in three functions SF Markus Elfring
2017-03-08 15:10 ` Devesh Sharma
2017-03-08 13:20 ` [PATCH 19/26] IB/ocrdma: Improve another size determination in ocrdma_alloc_mr() SF Markus Elfring
2017-03-08 15:07 ` Devesh Sharma
2017-03-09 12:03 ` Yuval Shaia
2017-03-08 13:22 ` [PATCH 20/26] IB/ocrdma: Delete an unnecessary variable assignment " SF Markus Elfring
2017-03-08 15:13 ` Devesh Sharma
2017-03-09 11:59 ` Yuval Shaia
2017-03-08 13:24 ` [PATCH 21/26] IB/ocrdma: Improve another size determination in ocrdma_create_srq() SF Markus Elfring
2017-03-08 15:15 ` Devesh Sharma
2017-03-09 11:46 ` Yuval Shaia
2017-03-08 13:26 ` [PATCH 22/26] IB/ocrdma: Returning only value constants in ocrdma_resize_cq() SF Markus Elfring
2017-03-08 15:16 ` Devesh Sharma
2017-03-09 12:01 ` Yuval Shaia
2017-03-08 13:28 ` [PATCH 23/26] IB/ocrdma: Delete an unnecessary variable in ocrdma_dealloc_pd() SF Markus Elfring
2017-03-08 15:16 ` Devesh Sharma
2017-03-09 11:57 ` Yuval Shaia
2017-03-08 13:30 ` [PATCH 24/26] IB/ocrdma: One jump label less in ocrdma_alloc_ucontext_pd() SF Markus Elfring
2017-03-08 15:17 ` Devesh Sharma
2017-03-09 11:55 ` Yuval Shaia
2017-03-08 13:32 ` [PATCH 25/26] IB/ocrdma: Delete unnecessary braces SF Markus Elfring
2017-03-09 11:50 ` Yuval Shaia
2017-03-08 13:34 ` [PATCH 26/26] IB/ocrdma: Adjust further ten checks for null pointers SF Markus Elfring
2017-03-08 15:18 ` Devesh Sharma
2017-03-09 11:43 ` Yuval Shaia
[not found] ` <1492720999.3041.18.camel@redhat.com>
2017-04-22 14:26 ` [PATCH v2 00/12] InfiniBand-OCRDMA: Fine-tuning for several function implementations SF Markus Elfring
2017-04-22 14:30 ` [PATCH v2 01/12] IB/ocrdma: Use kcalloc() in ocrdma_mbx_alloc_pd_range() SF Markus Elfring
2017-04-24 16:27 ` Devesh Sharma
2017-04-25 17:02 ` Doug Ledford
2017-08-08 17:26 ` [v2 " SF Markus Elfring
2017-08-09 6:43 ` Leon Romanovsky
2017-04-22 14:33 ` [PATCH v2 02/12] IB/ocrdma: Use kcalloc() in five functions SF Markus Elfring
2017-04-22 14:36 ` [PATCH v2 03/12] IB/ocrdma: Improve size determinations in ten functions SF Markus Elfring
2017-04-23 7:33 ` Leon Romanovsky
2017-04-24 12:54 ` Dennis Dalessandro
2017-04-24 13:23 ` SF Markus Elfring
2017-04-24 14:33 ` Leon Romanovsky
2017-04-24 14:54 ` SF Markus Elfring
2017-04-24 16:38 ` [PATCH v2 03/12] " Doug Ledford
2017-04-24 18:02 ` Leon Romanovsky
2017-04-24 16:38 ` Doug Ledford
2017-04-22 14:40 ` [PATCH v2 04/12] IB/ocrdma: Delete unnecessary variable initialisations in ocrdma_mbx_get_dcbx_config() SF Markus Elfring
2017-04-22 14:43 ` [PATCH v2 05/12] IB/ocrdma: Delete unnecessary braces SF Markus Elfring
2017-04-22 14:45 ` [PATCH v2 06/12] IB/ocrdma: Use kmalloc_array() in ocrdma_create_srq() SF Markus Elfring
2017-04-22 14:47 ` [PATCH v2 07/12] IB/ocrdma: Adjust 21 checks for null pointers SF Markus Elfring
2017-04-23 6:07 ` Leon Romanovsky
2017-04-22 14:48 ` [PATCH v2 08/12] IB/ocrdma: Delete an error message for a failed memory allocation in ocrdma_add() SF Markus Elfring
2017-04-22 14:49 ` [PATCH v2 09/12] IB/ocrdma: Delete an unnecessary variable assignment in ocrdma_alloc_mr() SF Markus Elfring
2017-04-22 14:50 ` [PATCH v2 10/12] IB/ocrdma: Returning only value constants in ocrdma_resize_cq() SF Markus Elfring
2017-04-22 14:51 ` [PATCH v2 11/12] IB/ocrdma: Delete an unnecessary variable in ocrdma_dealloc_pd() SF Markus Elfring
2017-04-22 14:54 ` SF Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d6fbc9e2-aaee-3c1f-e5b5-d7c09774557d@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=devesh.sharma@avagotech.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.com \
--cc=selvin.xavier@avagotech.com \
--cc=yuval.shaia@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox