[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210310180807.5fb1752d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Wed, 10 Mar 2021 18:08:07 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Alexander Duyck <alexander.duyck@...il.com>
Cc: netdev@...r.kernel.org, oss-drivers@...ronome.com,
simon.horman@...ronome.com, yisen.zhuang@...wei.com,
salil.mehta@...wei.com, intel-wired-lan@...ts.osuosl.org,
jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
drivers@...sando.io, snelson@...sando.io, netanel@...zon.com,
akiyano@...zon.com, gtzalik@...zon.com, saeedb@...zon.com,
GR-Linux-NIC-Dev@...vell.com, skalluru@...vell.com,
rmody@...vell.com, kys@...rosoft.com, haiyangz@...rosoft.com,
sthemmin@...rosoft.com, wei.liu@...nel.org, mst@...hat.com,
jasowang@...hat.com, pv-drivers@...are.com, doshir@...are.com,
alexanderduyck@...com
Subject: Re: [RFC PATCH 01/10] ethtool: Add common function for filling out
strings
On Wed, 10 Mar 2021 17:35:17 -0800 Alexander Duyck wrote:
> From: Alexander Duyck <alexanderduyck@...com>
>
> 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@...com>
> ---
> include/linux/ethtool.h | 9 +++++++++
> net/ethtool/ioctl.c | 12 ++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index ec4cd3921c67..0493f13b2b20 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_gsprintf - 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_gsprintf(u8 **data, const char *fmt, ...);
I'd drop the 'g' TBH, it seems to have made its way from the ethtool
command ('gstrings') to various places but without the 'string' after
it - it becomes less and less meaningful. Just ethtool_sprintf() would
be fine IMHO.
Other than that there is a minor rev xmas tree violation in patch 2 :)
Powered by blists - more mailing lists