summaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorjustinstitt@google.com <justinstitt@google.com>2023-12-06 23:16:10 +0000
committerDavid S. Miller <davem@davemloft.net>2023-12-08 10:56:25 +0000
commit2a48c635fd9a48699805bbfeee1e4b94b8fe819d (patch)
treee58c2217a3941f726485ab29e77a399f3be5b9d8 /include/linux/ethtool.h
parent09b489478383d9f3a04dfe5da72ae1b79af3e5f8 (diff)
downloadlinux-stable-2a48c635fd9a48699805bbfeee1e4b94b8fe819d.tar.gz
linux-stable-2a48c635fd9a48699805bbfeee1e4b94b8fe819d.tar.bz2
linux-stable-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 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c2bb74143eda..deb683d3360f 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -1061,6 +1061,19 @@ int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info
*/
extern __printf(2, 3) void ethtool_sprintf(u8 **data, const char *fmt, ...);
+/**
+ * ethtool_puts - Write string to ethtool string data
+ * @data: Pointer to a pointer to the start of string to update
+ * @str: String to write
+ *
+ * Write string to *data without a trailing newline. Update *data
+ * to point at start of next string.
+ *
+ * Prefer this function to ethtool_sprintf() when given only
+ * two arguments or if @fmt is just "%s".
+ */
+extern void ethtool_puts(u8 **data, const char *str);
+
/* Link mode to forced speed capabilities maps */
struct ethtool_forced_speed_map {
u32 speed;