aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_std_types_counters.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-04 08:50:30 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-04 13:47:01 -0600
commit540cd69209682a351ab76b83b85ea856b8192720 (patch)
treed5f6d2e7b23ec21c5ffde614fc5eb49f7f1e7712 /drivers/infiniband/core/uverbs_std_types_counters.c
parentRDMA/uverbs: Remove UA_FLAGS (diff)
downloadlinux-dev-540cd69209682a351ab76b83b85ea856b8192720.tar.xz
linux-dev-540cd69209682a351ab76b83b85ea856b8192720.zip
RDMA/uverbs: Use UVERBS_ATTR_MIN_SIZE correctly and uniformly
This newer macro allows specifying a lower bound on the accepted size, and has an 'unlimited' upper bound. Due to this it never checks for trailing zeroing so it doesn't make any sense to combine it with MIN_SZ_OR_ZERO, so drop MIN_SZ_OR_ZERO when they are used together There were a couple of places that open coded this pattern, switch them to use the clearer UVERBS_ATTR_MIN_SIZE for clarity. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_std_types_counters.c')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_counters.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_counters.c b/drivers/infiniband/core/uverbs_std_types_counters.c
index 202e3782e740..dfe59ad721f6 100644
--- a/drivers/infiniband/core/uverbs_std_types_counters.c
+++ b/drivers/infiniband/core/uverbs_std_types_counters.c
@@ -138,7 +138,6 @@ DECLARE_UVERBS_NAMED_METHOD_DESTROY(
UVERBS_ACCESS_DESTROY,
UA_MANDATORY));
-#define MAX_COUNTERS_BUFF_SIZE USHRT_MAX
DECLARE_UVERBS_NAMED_METHOD(
UVERBS_METHOD_COUNTERS_READ,
UVERBS_ATTR_IDR(UVERBS_ATTR_READ_COUNTERS_HANDLE,
@@ -146,7 +145,7 @@ DECLARE_UVERBS_NAMED_METHOD(
UVERBS_ACCESS_READ,
UA_MANDATORY),
UVERBS_ATTR_PTR_OUT(UVERBS_ATTR_READ_COUNTERS_BUFF,
- UVERBS_ATTR_SIZE(0, MAX_COUNTERS_BUFF_SIZE),
+ UVERBS_ATTR_MIN_SIZE(0),
UA_MANDATORY),
UVERBS_ATTR_PTR_IN(UVERBS_ATTR_READ_COUNTERS_FLAGS,
UVERBS_ATTR_TYPE(__u32),