Skip to contentSkip to conversation

net: ethtool: Fix documentation of ethtool_sprintf()

PATCH Applied Andrew Lunn 3 participants 3 messages Oct 28, 2023 – Nov 2, 2023

Subsystems (4)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

PATCH 1/1 net: ethtool: Fix documentation of ethtool_sprintf()

This function takes a pointer to a pointer, unlike sprintf() which is passed a plain pointer. Fix up the documentation to make this clear.

Fixes 7888fe53b706 ("ethtool: Add common function for filling out strings")
Cc Alexander Duyck <[email protected]>
Cc Justin Stitt <[email protected]>
---
 include/linux/ethtool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ethtool.h +2 -2
index 62b61527bcc4..1b523fd48586 100644
@@ -1045,10 +1045,10 @@ static inline int ethtool_mm_frag_size_min_to_add(u32 val_min, u32 *val_add,
 
 /**
  * ethtool_sprintf - Write formatted string to ethtool string data
- * @data: Pointer to start of string to update
+ * @data: Pointer to a pointer to the start of string to update
  * @fmt: Format of string to write
  *
- * Write formatted string to data. Update data to point at start of
+ * 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, ...);
Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Andrew Lunn

This function takes a pointer to a pointer, unlike sprintf() which is passed a plain pointer. Fix up the documentation to make this clear.

Fixes 7888fe53b706 ("ethtool: Add common function for filling out strings")
Cc Alexander Duyck <[email protected]>
Cc Justin Stitt <[email protected]>
---
 include/linux/ethtool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ethtool.h +2 -3
index 62b61527bcc4..1b523fd48586 100644
@@ -1045,10 +1045,10 @@ static inline int ethtool_mm_frag_size_min_to_add(u32 val_min, u32 *val_add,
 
 /**
  * ethtool_sprintf - Write formatted string to ethtool string data
- * @data: Pointer to start of string to update
+ * @data: Pointer to a pointer to the start of string to update
  * @fmt: Format of string to write
  *
- * Write formatted string to data. Update data to point at start of
+ * 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, ...);
--
Quoted 2 lines

2.42.0

Great! Now the docs more appropriately describe the behavior. My patch [1] for ethtool_puts() will use this same wording you've introduced.

[1]: https://lore.kernel.org/all/[email protected]/

Thanks
Justin

#2 lore raw
In reply to Andrew Lunn
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Sat, 28 Oct 2023 21:25:11 +0200 you wrote:

This function takes a pointer to a pointer, unlike sprintf() which is passed a plain pointer. Fix up the documentation to make this clear.

Fixes 7888fe53b706 ("ethtool: Add common function for filling out strings")
Cc Alexander Duyck <[email protected]>
Cc Justin Stitt <[email protected]>

[...]

Here is the summary with links:
- [v1,net] net: ethtool: Fix documentation of ethtool_sprintf()

    https://git.kernel.org/netdev/net/c/f55d8e60f109

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html