diff options
author | justinstitt@google.com <justinstitt@google.com> | 2023-12-06 23:16:10 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-08 10:56:25 +0000 |
commit | 2a48c635fd9a48699805bbfeee1e4b94b8fe819d (patch) | |
tree | e58c2217a3941f726485ab29e77a399f3be5b9d8 /net | |
parent | 09b489478383d9f3a04dfe5da72ae1b79af3e5f8 (diff) | |
download | linux-2a48c635fd9a48699805bbfeee1e4b94b8fe819d.tar.gz linux-2a48c635fd9a48699805bbfeee1e4b94b8fe819d.tar.bz2 linux-2a48c635fd9a48699805bbfeee1e4b94b8fe819d.zip |
ethtool: Implement ethtool_puts()
Use strscpy() to implement ethtool_puts().
Functionally the same as ethtool_sprintf() when it's used with two
arguments or with just "%s" format specifier.
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Madhuri Sripada <madhuri.sripada@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ethtool/ioctl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index a977f8903467..755a4be01bef 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -1994,6 +1994,13 @@ __printf(2, 3) void ethtool_sprintf(u8 **data, const char *fmt, ...) } EXPORT_SYMBOL(ethtool_sprintf); +void ethtool_puts(u8 **data, const char *str) +{ + strscpy(*data, str, ETH_GSTRING_LEN); + *data += ETH_GSTRING_LEN; +} +EXPORT_SYMBOL(ethtool_puts); + static int ethtool_phys_id(struct net_device *dev, void __user *useraddr) { struct ethtool_value id; |