diff options
author | Alexander Duyck <alexanderduyck@fb.com> | 2021-03-17 03:30:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-17 21:42:30 +0300 |
commit | 7888fe53b7066c284e172d98d98d1865d6a9e5a0 (patch) | |
tree | 7774816ad11687302b0fc973e93179e3eda1e586 /include/linux/ethtool.h | |
parent | 0c88eda9f5590eac0ac7e1963dd1f35b25b39c62 (diff) | |
download | linux-7888fe53b7066c284e172d98d98d1865d6a9e5a0.tar.xz |
ethtool: Add common function for filling out strings
Add a function to handle the common pattern of printing a string into the
ethtool strings interface and incrementing the string pointer by the
ETH_GSTRING_LEN. Most of the drivers end up doing this and several have
implemented their own versions of this function so it would make sense to
consolidate on one implementation.
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ec4cd3921c67..3583f7fc075c 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -571,4 +571,13 @@ struct ethtool_phy_ops { */ void ethtool_set_ethtool_phy_ops(const struct ethtool_phy_ops *ops); +/** + * ethtool_sprintf - Write formatted string to ethtool string data + * @data: Pointer to start of string to update + * @fmt: Format of string to write + * + * Write formatted string to data. Update data to point at start of + * next string. + */ +extern __printf(2, 3) void ethtool_sprintf(u8 **data, const char *fmt, ...); #endif /* _LINUX_ETHTOOL_H */ |