Skip to content

Commit

Permalink
ethtool: move ethtool_stats_init
Browse files Browse the repository at this point in the history
We'll need it for FEC stats as well.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Apr 16, 2021
1 parent 38ebcf5 commit c5797f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions include/linux/ethtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,

#define ETHTOOL_STAT_NOT_SET (~0ULL)

static inline void ethtool_stats_init(u64 *stats, unsigned int n)
{
while (n--)
stats[n] = ETHTOOL_STAT_NOT_SET;
}

/**
* struct ethtool_pause_stats - statistics for IEEE 802.3x pause frames
* @tx_pause_frames: transmitted pause frame count. Reported to user space
Expand Down
6 changes: 0 additions & 6 deletions net/ethtool/pause.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ const struct nla_policy ethnl_pause_get_policy[] = {
NLA_POLICY_NESTED(ethnl_header_policy_stats),
};

static void ethtool_stats_init(u64 *stats, unsigned int n)
{
while (n--)
stats[n] = ETHTOOL_STAT_NOT_SET;
}

static int pause_prepare_data(const struct ethnl_req_info *req_base,
struct ethnl_reply_data *reply_base,
struct genl_info *info)
Expand Down

0 comments on commit c5797f8

Please sign in to comment.