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>
This commit is contained in:

committed by
Jason Gunthorpe

parent
ebd6e96b33
commit
bebcfe85f4
@@ -420,9 +420,9 @@ struct uapi_definition {
|
||||
.scope = UAPI_SCOPE_OBJECT, \
|
||||
.needs_fn_offset = \
|
||||
offsetof(struct ib_device_ops, ibdev_fn) + \
|
||||
BUILD_BUG_ON_ZERO( \
|
||||
sizeof(((struct ib_device_ops *)0)->ibdev_fn) != \
|
||||
sizeof(void *)), \
|
||||
BUILD_BUG_ON_ZERO(sizeof_field(struct ib_device_ops, \
|
||||
ibdev_fn) != \
|
||||
sizeof(void *)), \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -435,9 +435,9 @@ struct uapi_definition {
|
||||
.scope = UAPI_SCOPE_METHOD, \
|
||||
.needs_fn_offset = \
|
||||
offsetof(struct ib_device_ops, ibdev_fn) + \
|
||||
BUILD_BUG_ON_ZERO( \
|
||||
sizeof(((struct ib_device_ops *)0)->ibdev_fn) != \
|
||||
sizeof(void *)), \
|
||||
BUILD_BUG_ON_ZERO(sizeof_field(struct ib_device_ops, \
|
||||
ibdev_fn) != \
|
||||
sizeof(void *)), \
|
||||
}
|
||||
|
||||
/* Call a function to determine if the entire object is supported or not */
|
||||
|
Reference in New Issue
Block a user