Skip to content

Commit e56b4ea

Browse files
Dr. David Alan Gilbertjgunthorpe
authored andcommitted
RDMA/siw: Remove unused siw_mem_add
siw_mem_add() was added in 2019 by commit 2251334 ("rdma/siw: application buffer management") but has remained unused. Remove it. Link: https://patch.msgid.link/r/20250505210226.88994-1-linux@treblig.org Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Acked-by: Bernard Metzler <bmt@zurich.ibm.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 7ccc2a0 commit e56b4ea

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

drivers/infiniband/sw/siw/siw_mem.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,6 @@
1717
/* Stag lookup is based on its index part only (24 bits). */
1818
#define SIW_STAG_MAX_INDEX 0x00ffffff
1919

20-
/*
21-
* The code avoids special Stag of zero and tries to randomize
22-
* STag values between 1 and SIW_STAG_MAX_INDEX.
23-
*/
24-
int siw_mem_add(struct siw_device *sdev, struct siw_mem *m)
25-
{
26-
struct xa_limit limit = XA_LIMIT(1, SIW_STAG_MAX_INDEX);
27-
u32 id, next;
28-
29-
get_random_bytes(&next, 4);
30-
next &= SIW_STAG_MAX_INDEX;
31-
32-
if (xa_alloc_cyclic(&sdev->mem_xa, &id, m, limit, &next,
33-
GFP_KERNEL) < 0)
34-
return -ENOMEM;
35-
36-
/* Set the STag index part */
37-
m->stag = id << 8;
38-
39-
siw_dbg_mem(m, "new MEM object\n");
40-
41-
return 0;
42-
}
43-
4420
/*
4521
* siw_mem_id2obj()
4622
*

drivers/infiniband/sw/siw/siw_mem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ void siw_umem_release(struct siw_umem *umem);
1212
struct siw_pbl *siw_pbl_alloc(u32 num_buf);
1313
dma_addr_t siw_pbl_get_buffer(struct siw_pbl *pbl, u64 off, int *len, int *idx);
1414
struct siw_mem *siw_mem_id2obj(struct siw_device *sdev, int stag_index);
15-
int siw_mem_add(struct siw_device *sdev, struct siw_mem *m);
1615
int siw_invalidate_stag(struct ib_pd *pd, u32 stag);
1716
int siw_check_mem(struct ib_pd *pd, struct siw_mem *mem, u64 addr,
1817
enum ib_access_flags perms, int len);

0 commit comments

Comments
 (0)