RDMA/efa: Use existing FIELD_SIZEOF macro
authorGal Pressman <galpress@amazon.com>
Mon, 26 Aug 2019 11:53:50 +0000 (14:53 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 27 Aug 2019 16:01:15 +0000 (13:01 -0300)
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 <dkkranzd@amazon.com>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c

index 1e23c621a419333b2795cc4c7722eebc8c62109a..4edae89e8e3ca882d50e81d644bb4385425a39d7 100644 (file)
@@ -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))