Skip to content

Commit

Permalink
replace code with FIELD_SIZEOF
Browse files Browse the repository at this point in the history
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Julia Lawall authored and Jeff Garzik committed Feb 11, 2008
1 parent 9dde447 commit 030ed68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct e1000_stats {
int stat_offset;
};

#define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
#define E1000_STAT(m) FIELD_SIZEOF(struct e1000_adapter, m), \
offsetof(struct e1000_adapter, m)
static const struct e1000_stats e1000_gstrings_stats[] = {
{ "rx_packets", E1000_STAT(stats.gprc) },
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct igb_stats {
int stat_offset;
};

#define IGB_STAT(m) sizeof(((struct igb_adapter *)0)->m), \
#define IGB_STAT(m) FIELD_SIZEOF(struct igb_adapter, m), \
offsetof(struct igb_adapter, m)
static const struct igb_stats igb_gstrings_stats[] = {
{ "rx_packets", IGB_STAT(stats.gprc) },
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ixgb/ixgb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct ixgb_stats {
int stat_offset;
};

#define IXGB_STAT(m) sizeof(((struct ixgb_adapter *)0)->m), \
#define IXGB_STAT(m) FIELD_SIZEOF(struct ixgb_adapter, m), \
offsetof(struct ixgb_adapter, m)
static struct ixgb_stats ixgb_gstrings_stats[] = {
{"rx_packets", IXGB_STAT(net_stats.rx_packets)},
Expand Down

0 comments on commit 030ed68

Please sign in to comment.