summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-05-27 14:18:45 -0300
committerJason Gunthorpe <jgg@mellanox.com>2020-05-29 15:27:04 -0300
commitffd7339a2fac98b9ff731e336c4411bf1ce57e22 (patch)
tree2f819428029a2e28df9ed2c34590a32c824352ec /include/rdma
parent48062b0a8ba0e0d7da2a96fe53028b7474e2dd26 (diff)
downloadlinux-ffd7339a2fac98b9ff731e336c4411bf1ce57e22.tar.gz
linux-ffd7339a2fac98b9ff731e336c4411bf1ce57e22.tar.bz2
linux-ffd7339a2fac98b9ff731e336c4411bf1ce57e22.zip
RDMA/core: Use offsetofend() instead of open coding
No reason to open code this. Link: https://lore.kernel.org/r/0-v1-0bc346e08476+585-drop_offsetofend_jgg@mellanox.com Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/uverbs_ioctl.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index 0418d7bddf3e..86de10ea30af 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -491,8 +491,7 @@ struct uapi_definition {
*/
#define UVERBS_ATTR_STRUCT(_type, _last) \
.zero_trailing = 1, \
- UVERBS_ATTR_SIZE(((uintptr_t)(&((_type *)0)->_last + 1)), \
- sizeof(_type))
+ UVERBS_ATTR_SIZE(offsetofend(_type, _last), sizeof(_type))
/*
* Specifies at least min_len bytes must be passed in, but the amount can be
* larger, up to the protocol maximum size. No check for zeroing is done.