All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Doug Ledford <dledford@redhat.com>
Cc: <linux-rdma@vger.kernel.org>, Gal Pressman <galpress@amazon.com>,
	"Daniel Kranzdorf" <dkkranzd@amazon.com>,
	Firas JahJah <firasj@amazon.com>
Subject: [PATCH for-next 2/2] RDMA/efa: Use existing FIELD_SIZEOF macro
Date: Mon, 26 Aug 2019 14:53:50 +0300	[thread overview]
Message-ID: <20190826115350.21718-3-galpress@amazon.com> (raw)
In-Reply-To: <20190826115350.21718-1-galpress@amazon.com>

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


  parent reply	other threads:[~2019-08-26 11:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 11:53 [PATCH for-next 0/2] EFA cleanups 2019-08-26 Gal Pressman
2019-08-26 11:53 ` [PATCH for-next 1/2] RDMA/efa: Remove umem check on dereg MR flow Gal Pressman
2019-08-26 11:53 ` Gal Pressman [this message]
2019-08-27 16:07 ` [PATCH for-next 0/2] EFA cleanups 2019-08-26 Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190826115350.21718-3-galpress@amazon.com \
    --to=galpress@amazon.com \
    --cc=dkkranzd@amazon.com \
    --cc=dledford@redhat.com \
    --cc=firasj@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.