diff mbox series

[v1,net] net: ethtool: Fix documentation of ethtool_sprintf()

Message ID 20231028192511.100001-1-andrew@lunn.ch (mailing list archive)
State Accepted
Commit f55d8e60f10909dbc5524e261041e1d28d7d20d8
Delegated to: Netdev Maintainers
Headers show
Series [v1,net] net: ethtool: Fix documentation of ethtool_sprintf() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3238 this patch: 3238
netdev/cc_maintainers fail 1 blamed authors not CCed: davem@davemloft.net; 3 maintainers not CCed: kuba@kernel.org davem@davemloft.net vladimir.oltean@nxp.com
netdev/build_clang success Errors and warnings before: 1581 this patch: 1581
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 3479 this patch: 3479
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andrew Lunn Oct. 28, 2023, 7:25 p.m. UTC
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 <alexanderduyck@fb.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 include/linux/ethtool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Justin Stitt Oct. 30, 2023, 5:40 p.m. UTC | #1
On Sat, Oct 28, 2023 at 12:25 PM Andrew Lunn <andrew@lunn.ch> 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 <alexanderduyck@fb.com>
> Cc: Justin Stitt <justinstitt@google.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  include/linux/ethtool.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 62b61527bcc4..1b523fd48586 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -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, ...);
> --
> 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.

Reviewed-by: Justin Stitt <justinstitt@google.com>

[1]: https://lore.kernel.org/all/20231027-ethtool_puts_impl-v3-0-3466ac679304@google.com/

Thanks
Justin
patchwork-bot+netdevbpf@kernel.org Nov. 2, 2023, 11:30 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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 <alexanderduyck@fb.com>
> Cc: Justin Stitt <justinstitt@google.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 62b61527bcc4..1b523fd48586 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -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, ...);