[PATCH 1/3] batman-adv: Use FIELD_SIZEOF directly

From: zhong jiang
Date: Thu Sep 05 2019 - 08:54:55 EST


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

Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx>
---
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