netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 2/3] r8169: use macro FIELD_SIZEOF in definition of FW_OPCODE_SIZE
Date: Wed, 20 Nov 2019 21:07:41 +0100	[thread overview]
Message-ID: <f1e304a7-d8e1-c4c9-9c0a-d17ffcfae603@gmail.com> (raw)
In-Reply-To: <6bb940ea-f479-f264-bc12-b4be52293dd6@gmail.com>

Using macro FIELD_SIZEOF makes this define easier understandable.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_firmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169_firmware.c b/drivers/net/ethernet/realtek/r8169_firmware.c
index 522415084..927bb46b3 100644
--- a/drivers/net/ethernet/realtek/r8169_firmware.c
+++ b/drivers/net/ethernet/realtek/r8169_firmware.c
@@ -37,7 +37,7 @@ struct fw_info {
 	u8	chksum;
 } __packed;
 
-#define FW_OPCODE_SIZE	sizeof(typeof(*((struct rtl_fw_phy_action *)0)->code))
+#define FW_OPCODE_SIZE FIELD_SIZEOF(struct rtl_fw_phy_action, code[0])
 
 static bool rtl_fw_format_ok(struct rtl_fw *rtl_fw)
 {
-- 
2.24.0



  parent reply	other threads:[~2019-11-20 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 20:06 [PATCH net-next 0/3] r8169: smaller improvements to firmware handling Heiner Kallweit
2019-11-20 20:06 ` [PATCH net-next 1/3] r8169: change mdelay to msleep in rtl_fw_write_firmware Heiner Kallweit
2019-11-20 20:07 ` Heiner Kallweit [this message]
2019-11-20 20:08 ` [PATCH net-next 3/3] r8169: add check for PHY_MDIO_CHG to rtl_nic_fw_data_ok Heiner Kallweit
2019-11-20 20:50 ` [PATCH net-next 0/3] r8169: smaller improvements to firmware handling David Miller

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=f1e304a7-d8e1-c4c9-9c0a-d17ffcfae603@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /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;
as well as URLs for NNTP newsgroup(s).