summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/uverbs_ioctl.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2020-05-27 09:41:52 -0500
committerJason Gunthorpe <jgg@mellanox.com>2020-05-27 13:46:05 -0300
commitbebcfe85f4338ba1434561a460169a5e0af78f98 (patch)
tree5e6e85eea42137cbd5fee745abd5ccb9ddd33ba9 /drivers/infiniband/core/uverbs_ioctl.c
parentebd6e96b33a23fe84d1a64441a04d7bc91ccc519 (diff)
downloadlinux-bebcfe85f4338ba1434561a460169a5e0af78f98.tar.gz
RDMA/core: Use sizeof_field() helper
Make use of the sizeof_field() helper instead of an open-coded version. Link: https://lore.kernel.org/r/20200527144152.GA22605@embeddedor Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_ioctl.c')
-rw-r--r--drivers/infiniband/core/uverbs_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 42c5696f03bd..2d882c02387c 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -137,7 +137,7 @@ EXPORT_SYMBOL(_uverbs_alloc);
static bool uverbs_is_attr_cleared(const struct ib_uverbs_attr *uattr,
u16 len)
{
- if (uattr->len > sizeof(((struct ib_uverbs_attr *)0)->data))
+ if (uattr->len > sizeof_field(struct ib_uverbs_attr, data))
return ib_is_buffer_cleared(u64_to_user_ptr(uattr->data) + len,
uattr->len - len);