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>
This commit is contained in:
Jason Gunthorpe 2020-05-27 14:18:45 -03:00
parent 48062b0a8b
commit ffd7339a2f

View File

@ -491,8 +491,7 @@ struct uapi_definition {
*/ */
#define UVERBS_ATTR_STRUCT(_type, _last) \ #define UVERBS_ATTR_STRUCT(_type, _last) \
.zero_trailing = 1, \ .zero_trailing = 1, \
UVERBS_ATTR_SIZE(((uintptr_t)(&((_type *)0)->_last + 1)), \ UVERBS_ATTR_SIZE(offsetofend(_type, _last), sizeof(_type))
sizeof(_type))
/* /*
* Specifies at least min_len bytes must be passed in, but the amount can be * 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. * larger, up to the protocol maximum size. No check for zeroing is done.