]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/cxgb3: Use structs to describe the uABI instead of opencoding
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 20 Mar 2018 19:59:50 +0000 (13:59 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 22 Mar 2018 18:42:48 +0000 (12:42 -0600)
Open coding a loose value is not acceptable for describing the uABI in
RDMA. Provide the missing struct.

Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/cxgb3/iwch_provider.c
include/uapi/rdma/cxgb3-abi.h

index 1804b6c4a6ec13415a9075e32a9f059c03e30968..be097c6723c0f2b56d2af959ac671bc2fe1821dc 100644 (file)
@@ -440,7 +440,9 @@ static struct ib_pd *iwch_allocate_pd(struct ib_device *ibdev,
        php->pdid = pdid;
        php->rhp = rhp;
        if (context) {
-               if (ib_copy_to_udata(udata, &php->pdid, sizeof (__u32))) {
+               struct iwch_alloc_pd_resp resp = {.pdid = php->pdid};
+
+               if (ib_copy_to_udata(udata, &resp, sizeof(resp))) {
                        iwch_deallocate_pd(&php->ibpd);
                        return ERR_PTR(-EFAULT);
                }
index d5745e43ae857179723a294f1798e87975380fc4..17116c1c792586953cd76f1a4aeea645f7ba7954 100644 (file)
@@ -74,4 +74,9 @@ struct iwch_create_qp_resp {
 struct iwch_reg_user_mr_resp {
        __u32 pbl_addr;
 };
+
+struct iwch_alloc_pd_resp {
+       __u32 pdid;
+};
+
 #endif /* CXGB3_ABI_USER_H */