diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 08:50:29 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 13:47:01 -0600 |
commit | 83bb4442330f035bd68ec5d2f5b87bfef1c1a4ab (patch) | |
tree | a7f379039f73da8d9c1012dbb31d7a2ad106d1d1 /drivers/infiniband/core/uverbs_ioctl.c | |
parent | RDMA/uverbs: Get rid of the & in method specifications (diff) | |
download | linux-dev-83bb4442330f035bd68ec5d2f5b87bfef1c1a4ab.tar.xz linux-dev-83bb4442330f035bd68ec5d2f5b87bfef1c1a4ab.zip |
RDMA/uverbs: Remove UA_FLAGS
This bit of boilerplate isn't really necessary, we can use bitfields
instead of a flags enum and the macros can then individually initialize
them through the __VA_ARGS__ like everything else.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_ioctl.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_ioctl.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c index 62f7382e8513..cb6109036129 100644 --- a/drivers/infiniband/core/uverbs_ioctl.c +++ b/drivers/infiniband/core/uverbs_ioctl.c @@ -98,14 +98,14 @@ static int uverbs_process_attr(struct ib_uverbs_file *ufile, * non-zero content, making ABI compat/discovery simpler. */ if (uattr->len > val_spec->u.ptr.len && - val_spec->flags & UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO && + val_spec->min_sz_or_zero && !uverbs_is_attr_cleared(uattr, val_spec->u.ptr.len)) return -EOPNOTSUPP; /* fall through */ case UVERBS_ATTR_TYPE_PTR_OUT: if (uattr->len < val_spec->u.ptr.min_len || - (!(val_spec->flags & UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO) && + (!val_spec->min_sz_or_zero && uattr->len > val_spec->u.ptr.len)) return -EINVAL; @@ -116,8 +116,7 @@ static int uverbs_process_attr(struct ib_uverbs_file *ufile, e->ptr_attr.len = uattr->len; e->ptr_attr.flags = uattr->flags; - if (val_spec->flags & UVERBS_ATTR_SPEC_F_ALLOC_AND_COPY && - !uverbs_attr_ptr_is_inline(e)) { + if (val_spec->alloc_and_copy && !uverbs_attr_ptr_is_inline(e)) { void *p; p = kvmalloc(uattr->len, GFP_KERNEL); @@ -220,8 +219,7 @@ static int uverbs_finalize_attrs(struct uverbs_attr_bundle *attrs_bundle, if (!ret) ret = current_ret; } else if (spec->type == UVERBS_ATTR_TYPE_PTR_IN && - spec->flags & - UVERBS_ATTR_SPEC_F_ALLOC_AND_COPY && + spec->alloc_and_copy && !uverbs_attr_ptr_is_inline(attr)) { kvfree(attr->ptr_attr.ptr); } |