Skip to content

Commit

Permalink
RDMA/core: Use offsetofend() instead of open coding
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gunthorpe committed May 29, 2020
1 parent 48062b0 commit ffd7339
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/rdma/uverbs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ffd7339

Please sign in to comment.