Commit 7f86260b authored by Jason Gunthorpe's avatar Jason Gunthorpe

RDMA/cxgb4: Use structs to describe the uABI instead of opencoding

Open coding a loose value is not acceptable for describing the uABI in
RDMA. Provide the missing struct.
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 633fb4d9
...@@ -281,7 +281,9 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev, ...@@ -281,7 +281,9 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev,
php->pdid = pdid; php->pdid = pdid;
php->rhp = rhp; php->rhp = rhp;
if (context) { if (context) {
if (ib_copy_to_udata(udata, &php->pdid, sizeof(u32))) { struct c4iw_alloc_pd_resp uresp = {.pdid = php->pdid};
if (ib_copy_to_udata(udata, &uresp, sizeof(uresp))) {
c4iw_deallocate_pd(&php->ibpd); c4iw_deallocate_pd(&php->ibpd);
return ERR_PTR(-EFAULT); return ERR_PTR(-EFAULT);
} }
......
...@@ -79,4 +79,9 @@ struct c4iw_alloc_ucontext_resp { ...@@ -79,4 +79,9 @@ struct c4iw_alloc_ucontext_resp {
__u32 status_page_size; __u32 status_page_size;
__u32 reserved; /* explicit padding (optional for i386) */ __u32 reserved; /* explicit padding (optional for i386) */
}; };
struct c4iw_alloc_pd_resp {
__u32 pdid;
};
#endif /* CXGB4_ABI_USER_H */ #endif /* CXGB4_ABI_USER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment