diff mbox series

[for-next,2/2] RDMA/efa: Use existing FIELD_SIZEOF macro

Message ID 20190826115350.21718-3-galpress@amazon.com (mailing list archive)
State Mainlined
Commit 1bc5ba836e3ba02b8c7981a1fb453fe33513526d
Delegated to: Jason Gunthorpe
Headers show
Series EFA cleanups 2019-08-26 | expand

Commit Message

Gal Pressman Aug. 26, 2019, 11:53 a.m. UTC
Use FIELD_SIZEOF macro instead of hard coding it in field_avail macro.

Reviewed-by: Daniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 drivers/infiniband/hw/efa/efa_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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))