Skip to content

Commit

Permalink
r8169: use macro FIELD_SIZEOF in definition of FW_OPCODE_SIZE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Nov 20, 2019
1 parent e20c43d commit cfccde8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/realtek/r8169_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit cfccde8

Please sign in to comment.