Skip to content

Commit b72bfc9

Browse files
committed
RDMA/core: Get rid of ib_create_qp_user
This function accepts a udata but does nothing with it, and is never passed a !NULL udata. Rename it to ib_create_qp which was the only caller and remove the udata. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent b537428 commit b72bfc9

File tree

2 files changed

+17
-36
lines changed

2 files changed

+17
-36
lines changed

drivers/infiniband/core/verbs.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,7 @@ struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
11271127
EXPORT_SYMBOL(ib_open_qp);
11281128

11291129
static struct ib_qp *create_xrc_qp_user(struct ib_qp *qp,
1130-
struct ib_qp_init_attr *qp_init_attr,
1131-
struct ib_udata *udata)
1130+
struct ib_qp_init_attr *qp_init_attr)
11321131
{
11331132
struct ib_qp *real_qp = qp;
11341133

@@ -1150,9 +1149,18 @@ static struct ib_qp *create_xrc_qp_user(struct ib_qp *qp,
11501149
return qp;
11511150
}
11521151

1153-
struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
1154-
struct ib_qp_init_attr *qp_init_attr,
1155-
struct ib_udata *udata)
1152+
/**
1153+
* ib_create_qp - Creates a kernel QP associated with the specified protection
1154+
* domain.
1155+
* @pd: The protection domain associated with the QP.
1156+
* @qp_init_attr: A list of initial attributes required to create the
1157+
* QP. If QP creation succeeds, then the attributes are updated to
1158+
* the actual capabilities of the created QP.
1159+
*
1160+
* NOTE: for user qp use ib_create_qp_user with valid udata!
1161+
*/
1162+
struct ib_qp *ib_create_qp(struct ib_pd *pd,
1163+
struct ib_qp_init_attr *qp_init_attr)
11561164
{
11571165
struct ib_device *device = pd ? pd->device : qp_init_attr->xrcd->device;
11581166
struct ib_qp *qp;
@@ -1197,7 +1205,7 @@ struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
11971205

11981206
if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) {
11991207
struct ib_qp *xrc_qp =
1200-
create_xrc_qp_user(qp, qp_init_attr, udata);
1208+
create_xrc_qp_user(qp, qp_init_attr);
12011209

12021210
if (IS_ERR(xrc_qp)) {
12031211
ret = PTR_ERR(xrc_qp);
@@ -1253,7 +1261,7 @@ struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
12531261
return ERR_PTR(ret);
12541262

12551263
}
1256-
EXPORT_SYMBOL(ib_create_qp_user);
1264+
EXPORT_SYMBOL(ib_create_qp);
12571265

12581266
static const struct {
12591267
int valid;

include/rdma/ib_verbs.h

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,35 +3627,8 @@ static inline int ib_post_srq_recv(struct ib_srq *srq,
36273627
bad_recv_wr ? : &dummy);
36283628
}
36293629

3630-
/**
3631-
* ib_create_qp_user - Creates a QP associated with the specified protection
3632-
* domain.
3633-
* @pd: The protection domain associated with the QP.
3634-
* @qp_init_attr: A list of initial attributes required to create the
3635-
* QP. If QP creation succeeds, then the attributes are updated to
3636-
* the actual capabilities of the created QP.
3637-
* @udata: Valid user data or NULL for kernel objects
3638-
*/
3639-
struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
3640-
struct ib_qp_init_attr *qp_init_attr,
3641-
struct ib_udata *udata);
3642-
3643-
/**
3644-
* ib_create_qp - Creates a kernel QP associated with the specified protection
3645-
* domain.
3646-
* @pd: The protection domain associated with the QP.
3647-
* @qp_init_attr: A list of initial attributes required to create the
3648-
* QP. If QP creation succeeds, then the attributes are updated to
3649-
* the actual capabilities of the created QP.
3650-
* @udata: Valid user data or NULL for kernel objects
3651-
*
3652-
* NOTE: for user qp use ib_create_qp_user with valid udata!
3653-
*/
3654-
static inline struct ib_qp *ib_create_qp(struct ib_pd *pd,
3655-
struct ib_qp_init_attr *qp_init_attr)
3656-
{
3657-
return ib_create_qp_user(pd, qp_init_attr, NULL);
3658-
}
3630+
struct ib_qp *ib_create_qp(struct ib_pd *pd,
3631+
struct ib_qp_init_attr *qp_init_attr);
36593632

36603633
/**
36613634
* ib_modify_qp_with_udata - Modifies the attributes for the specified QP.

0 commit comments

Comments
 (0)