[PATCH net-next v5 3/3] net: Convert some ethtool_sprintf() to ethtool_puts()

2023-12-06 Thread justinstitt
This patch converts some basic cases of ethtool_sprintf() to ethtool_puts(). The conversions are used in cases where ethtool_sprintf() was being used with just two arguments: | ethtool_sprintf(&data, buffer[i].name); or when it's used with format string: "%s" | ethtool_sprintf(&data, "

[PATCH net-next v5 2/3] checkpatch: add ethtool_sprintf rules

2023-12-06 Thread justinstitt
Add some warnings for using ethtool_sprintf() where a simple ethtool_puts() would suffice. The two cases are: 1) Use ethtool_sprintf() with just two arguments: | ethtool_sprintf(&data, driver[i].name); or 2) Use ethtool_sprintf() with a standalone "%s" fmt string: | ethtool_sprintf(&d

[PATCH net-next v5 1/3] ethtool: Implement ethtool_puts()

2023-12-06 Thread justinstitt
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 --- include/linux/ethtool.h | 13 + net/ethtool/ioctl.c | 7 +++ 2 files changed, 20 inser

[PATCH net-next v5 0/3] ethtool: Add ethtool_puts()

2023-12-06 Thread justinstitt
Hi, This series aims to implement ethtool_puts() and send out a wave 1 of conversions from ethtool_sprintf(). There's also a checkpatch patch included to check for the cases listed below. This was sparked from recent discussion here [1] The conversions are used in cases where ethtool_sprintf() w