From: yanjun.zhu@linux.dev
To: zyjzyj2000@gmail.com, yanjun.zhu@intel.com,
mustafa.ismail@intel.com, shiraz.saleem@intel.com,
dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org,
yanjun.zhu@linux.dev, leon@kernel.org
Subject: [PATCH 2/3] RDMA/irdma: change the returned type of irdma_set_hw_rsrc to void
Date: Tue, 13 Jul 2021 23:11:29 -0400 [thread overview]
Message-ID: <20210714031130.1511109-3-yanjun.zhu@linux.dev> (raw)
In-Reply-To: <20210714031130.1511109-1-yanjun.zhu@linux.dev>
From: Zhu Yanjun <yanjun.zhu@linux.dev>
Since the function irdma_set_hw_rsrc always returns zero, change
the returned type to void and remove all the related source code.
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
drivers/infiniband/hw/irdma/hw.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c
index 7afb8a6a0526..00de5ee9a260 100644
--- a/drivers/infiniband/hw/irdma/hw.c
+++ b/drivers/infiniband/hw/irdma/hw.c
@@ -1920,7 +1920,7 @@ enum irdma_status_code irdma_ctrl_init_hw(struct irdma_pci_f *rf)
* irdma_set_hw_rsrc - set hw memory resources.
* @rf: RDMA PCI function
*/
-static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
+static void irdma_set_hw_rsrc(struct irdma_pci_f *rf)
{
rf->allocated_qps = (void *)(rf->mem_rsrc +
(sizeof(struct irdma_arp_entry) * rf->arp_table_size));
@@ -1937,8 +1937,6 @@ static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
spin_lock_init(&rf->arp_lock);
spin_lock_init(&rf->qptable_lock);
spin_lock_init(&rf->qh_list_lock);
-
- return 0;
}
/**
@@ -2000,9 +1998,7 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
rf->arp_table = (struct irdma_arp_entry *)rf->mem_rsrc;
- ret = irdma_set_hw_rsrc(rf);
- if (ret)
- goto set_hw_rsrc_fail;
+ irdma_set_hw_rsrc(rf);
set_bit(0, rf->allocated_mrs);
set_bit(0, rf->allocated_qps);
@@ -2025,9 +2021,6 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
return 0;
-set_hw_rsrc_fail:
- kfree(rf->mem_rsrc);
- rf->mem_rsrc = NULL;
mem_rsrc_kzalloc_fail:
kfree(rf->allocated_ws_nodes);
rf->allocated_ws_nodes = NULL;
--
2.27.0
next prev parent reply other threads:[~2021-07-13 10:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
2021-07-14 3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
2021-07-14 9:14 ` Leon Romanovsky
2021-07-14 9:23 ` Zhu Yanjun
2021-07-18 9:27 ` Leon Romanovsky
2021-07-14 3:11 ` yanjun.zhu [this message]
2021-07-14 3:11 ` [PATCH 3/3] RDMA/irdma: change returned type of irdma_setup_virt_qp " yanjun.zhu
2021-07-15 18:19 ` [PATCH 0/3] RDMA/irdma: do some cleanups Jason Gunthorpe
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=20210714031130.1511109-3-yanjun.zhu@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@intel.com \
--cc=yanjun.zhu@intel.com \
--cc=zyjzyj2000@gmail.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