1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/igb
Jesse Brandeburg 1978d3ead8 intel: fix string truncation warnings
Fix -Wformat-truncated warnings to complete the intel directories' W=1
clean efforts. The W=1 recently got enhanced with a few new flags and
this brought up some new warnings.

Switch to using kasprintf() when possible so we always allocate the
right length strings.

summary of warnings:
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1425:60: warning: ‘%s’ directive output may be truncated writing 4 bytes into a region of size between 1 and 11 [-Wformat-truncation=]
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1425:17: note: ‘snprintf’ output between 7 and 17 bytes into a destination of size 13
drivers/net/ethernet/intel/ice/ice_ptp.c:43:27: warning: ‘%s’ directive output may be truncated writing up to 479 bytes into a region of size 64 [-Wformat-truncation=]
drivers/net/ethernet/intel/ice/ice_ptp.c:42:17: note: ‘snprintf’ output between 1 and 480 bytes into a destination of size 64
drivers/net/ethernet/intel/igb/igb_main.c:3092:53: warning: ‘%d’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 1 and 13 [-Wformat-truncation=]
drivers/net/ethernet/intel/igb/igb_main.c:3092:34: note: directive argument in the range [0, 65535]
drivers/net/ethernet/intel/igb/igb_main.c:3092:34: note: directive argument in the range [0, 65535]
drivers/net/ethernet/intel/igb/igb_main.c:3090:25: note: ‘snprintf’ output between 23 and 43 bytes into a destination of size 32

Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231017190411.2199743-2-jacob.e.keller@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-10-18 18:10:16 -07:00
..
e1000_82575.c igb: remove unexpected word "the" 2022-06-30 10:43:18 -07:00
e1000_82575.h igb: Add UDP segmentation offload support 2019-10-29 21:05:33 -07:00
e1000_defines.h igb: Remove duplicate defines 2022-06-09 10:05:31 -07:00
e1000_hw.h igb: Fix duplicate include guard 2021-03-19 08:47:46 -07:00
e1000_i210.c igb: remove never changed variable `ret_val' 2021-12-21 09:17:47 -08:00
e1000_i210.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mac.c igb: fix bit_shift to be in [1..8] range 2023-05-17 09:25:04 +01:00
e1000_mac.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mbx.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
e1000_mbx.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_nvm.c ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
e1000_nvm.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_phy.c igb: Fix fall-through warnings for Clang 2021-03-23 11:34:02 -07:00
e1000_phy.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_regs.h igb: Remove duplicate defines 2022-06-09 10:05:31 -07:00
igb.h igb: Change IGB_MIN to allow set rx/tx value between 64 and 80 2023-09-05 10:52:25 -07:00
igb_ethtool.c igb: fix nvm.ops.read() error handling 2023-06-12 13:33:22 -07:00
igb_hwmon.c igb: convert to use i2c_new_client_device() 2020-03-26 19:31:21 -07:00
igb_main.c intel: fix string truncation warnings 2023-10-18 18:10:16 -07:00
igb_ptp.c igb: Avoid starting unnecessary workqueues 2023-08-22 17:24:28 -07:00
Makefile net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00