r8169: use macro FIELD_SIZEOF in definition of FW_OPCODE_SIZE
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 20 Nov 2019 20:07:41 +0000 (21:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 20:50:24 +0000 (12:50 -0800)
Using macro FIELD_SIZEOF makes this define easier understandable.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_firmware.c

index 52241508473a7ba93ee59e827bece0b842b9f321..927bb46b32d7097bb138c0f8cbb12f8d6895cb08 100644 (file)
@@ -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)
 {