Document that the 'len' field in ethtool_gstrings and 'n_stats' field in ethtool_stats serve dual purposes: on entry they specify the number of items requested, and on return they indicate the number actually returned (which is not necessarily the same). Reviewed-by: Dragos Tatulea Signed-off-by: Gal Pressman --- include/uapi/linux/ethtool.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index eb7ff2602fbb..f66adf15a3c8 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -1094,7 +1094,8 @@ enum ethtool_module_fw_flash_status { * struct ethtool_gstrings - string set for data tagging * @cmd: Command number = %ETHTOOL_GSTRINGS * @string_set: String set ID; one of &enum ethtool_stringset - * @len: On return, the number of strings in the string set + * @len: On entry, the number of strings requested. + * On return, the number of strings returned. * @data: Buffer for strings. Each string is null-padded to a size of * %ETH_GSTRING_LEN. * @@ -1177,7 +1178,8 @@ struct ethtool_test { /** * struct ethtool_stats - device-specific statistics * @cmd: Command number = %ETHTOOL_GSTATS - * @n_stats: On return, the number of statistics + * @n_stats: On entry, the number of stats requested. + On return, the number of stats returned. * @data: Array of statistics * * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the -- 2.40.1