mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>, <mareklindner@neomailbox.ch>,
	<mchehab@kernel.org>, <leon@kernel.org>
Cc: <dledford@redhat.com>, <sakari.ailus@linux.intel.com>,
	<a@unstable.cc>, <sw@simonwunderlich.de>,
	<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
	<zhongjiang@huawei.com>
Subject: [PATCH 1/3] batman-adv: Use FIELD_SIZEOF directly
Date: Thu, 5 Sep 2019 20:51:34 +0800	[thread overview]
Message-ID: <1567687896-19996-2-git-send-email-zhongjiang@huawei.com> (raw)
In-Reply-To: <1567687896-19996-1-git-send-email-zhongjiang@huawei.com>

It's more clear to use FIELD_SIZEOF instead of its implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/batman-adv/distributed-arp-table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index b0af3a1..c79fdf8 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -91,8 +91,8 @@ struct batadv_dhcp_packet {
 	__u8 options[0];
 };
 
-#define BATADV_DHCP_YIADDR_LEN sizeof(((struct batadv_dhcp_packet *)0)->yiaddr)
-#define BATADV_DHCP_CHADDR_LEN sizeof(((struct batadv_dhcp_packet *)0)->chaddr)
+#define BATADV_DHCP_YIADDR_LEN FIELD_SIZEOF(struct batadv_dhcp_packet, yiaddr)
+#define BATADV_DHCP_CHADDR_LEN FIELD_SIZEOF(struct batadv_dhcp_packet, chaddr)
 
 static void batadv_dat_purge(struct work_struct *work);
 
-- 
1.7.12.4


  reply	other threads:[~2019-09-05 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 12:51 [PATCH 0/3] replace code with FIELD_SIZEOF zhong jiang
2019-09-05 12:51 ` zhong jiang [this message]
2019-09-05 12:51 ` [PATCH 2/3] media: v4l2: Use FIELD_SIZEOF directly zhong jiang
2019-09-05 13:53   ` Sakari Ailus
2019-09-05 12:51 ` [PATCH 3/3] IB/mlx5: " zhong jiang

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=1567687896-19996-2-git-send-email-zhongjiang@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=a@unstable.cc \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sw@simonwunderlich.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®