From: Gal Pressman Date: Mon, 26 Aug 2019 11:53:50 +0000 (+0300) Subject: RDMA/efa: Use existing FIELD_SIZEOF macro X-Git-Tag: for-linus-2019-09-27~51^2~29 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1bc5ba836e3ba02b8c7981a1fb453fe33513526d;p=linux-block.git RDMA/efa: Use existing FIELD_SIZEOF macro Use FIELD_SIZEOF macro instead of hard coding it in field_avail macro. Link: https://lore.kernel.org/r/20190826115350.21718-3-galpress@amazon.com Reviewed-by: Daniel Kranzdorf Reviewed-by: Firas JahJah Signed-off-by: Gal Pressman Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 1e23c621a419..4edae89e8e3c 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -148,7 +148,7 @@ static inline struct efa_ah *to_eah(struct ib_ah *ibah) } #define field_avail(x, fld, sz) (offsetof(typeof(x), fld) + \ - sizeof(((typeof(x) *)0)->fld) <= (sz)) + FIELD_SIZEOF(typeof(x), fld) <= (sz)) #define is_reserved_cleared(reserved) \ !memchr_inv(reserved, 0, sizeof(reserved))