diff options
author | Simon Horman <[email protected]> | 2024-05-08 09:32:20 +0100 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-05-10 18:40:49 -0700 |
commit | ba8bcb012b7d6efbac30038d82bd67b70e4597d7 (patch) | |
tree | 232f40da2be09ff069ebea34574a237ca63008ae /scripts/gdb/linux/tasks.py | |
parent | ebb8308eac84787c891483af50091a295cdd54ea (diff) |
gve: Use ethtool_sprintf/puts() to fill stats strings
Make use of standard helpers to simplify filling in stats strings.
The first two ethtool_puts() changes address the following fortification
warnings flagged by W=1 builds with clang-18. (The last ethtool_puts
change does not because the warning relates to writing beyond the first
element of an array, and gve_gstrings_priv_flags only has one element.)
.../fortify-string.h:562:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
562 | __read_overflow2_field(q_size_field, size);
| ^
.../fortify-string.h:562:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
Likewise, the same changes resolve the same problems flagged by Smatch.
.../gve_ethtool.c:100 gve_get_strings() error: __builtin_memcpy() '*gve_gstrings_main_stats' too small (32 vs 576)
.../gve_ethtool.c:120 gve_get_strings() error: __builtin_memcpy() '*gve_gstrings_adminq_stats' too small (32 vs 512)
Compile tested only.
Reviewed-by: Shailend Chand <[email protected]>
Reviewed-by: Larysa Zaremba <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Acked-by: Justin Stitt <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
0 files changed, 0 insertions, 0 deletions