projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48062b0
)
RDMA/core: Use offsetofend() instead of open coding
author
Jason Gunthorpe
<jgg@mellanox.com>
Wed, 27 May 2020 17:18:45 +0000
(14:18 -0300)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Fri, 29 May 2020 18:27:04 +0000
(15:27 -0300)
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>
include/rdma/uverbs_ioctl.h
patch
|
blob
|
history
diff --git
a/include/rdma/uverbs_ioctl.h
b/include/rdma/uverbs_ioctl.h
index
0418d7b
..
86de10e
100644
(file)
--- 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.