Skip to content

Commit 41f5fa9

Browse files
zhuyjjgunthorpe
authored andcommitted
RDMA/irdma: Change the returned type of irdma_set_hw_rsrc to void
Since the function irdma_set_hw_rsrc always returns zero, change the returned type to void and remove all the related source code. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Zhu Yanjun <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent a323da0 commit 41f5fa9

File tree

1 file changed

+2
-9
lines changed
  • drivers/infiniband/hw/irdma

1 file changed

+2
-9
lines changed

drivers/infiniband/hw/irdma/hw.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ enum irdma_status_code irdma_ctrl_init_hw(struct irdma_pci_f *rf)
19201920
* irdma_set_hw_rsrc - set hw memory resources.
19211921
* @rf: RDMA PCI function
19221922
*/
1923-
static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
1923+
static void irdma_set_hw_rsrc(struct irdma_pci_f *rf)
19241924
{
19251925
rf->allocated_qps = (void *)(rf->mem_rsrc +
19261926
(sizeof(struct irdma_arp_entry) * rf->arp_table_size));
@@ -1937,8 +1937,6 @@ static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
19371937
spin_lock_init(&rf->arp_lock);
19381938
spin_lock_init(&rf->qptable_lock);
19391939
spin_lock_init(&rf->qh_list_lock);
1940-
1941-
return 0;
19421940
}
19431941

19441942
/**
@@ -2000,9 +1998,7 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
20001998

20011999
rf->arp_table = (struct irdma_arp_entry *)rf->mem_rsrc;
20022000

2003-
ret = irdma_set_hw_rsrc(rf);
2004-
if (ret)
2005-
goto set_hw_rsrc_fail;
2001+
irdma_set_hw_rsrc(rf);
20062002

20072003
set_bit(0, rf->allocated_mrs);
20082004
set_bit(0, rf->allocated_qps);
@@ -2025,9 +2021,6 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
20252021

20262022
return 0;
20272023

2028-
set_hw_rsrc_fail:
2029-
kfree(rf->mem_rsrc);
2030-
rf->mem_rsrc = NULL;
20312024
mem_rsrc_kzalloc_fail:
20322025
kfree(rf->allocated_ws_nodes);
20332026
rf->allocated_ws_nodes = NULL;

0 commit comments

Comments
 (0)