linux_dsm_epyc7002/drivers/net/ethernet/intel
Tony Nguyen 31f5d9b1e8 ixgbevf: Resolve truncation warning for q_vector->name
The following warning is now shown as a result of new checks added for
gcc 7:

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function ‘ixgbevf_open’:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:13: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size between 3 and 18 [-Wformat-truncation=]
      "%s-%s-%d", netdev->name, "TxRx", ri++);
             ^~
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:6: note: directive argument in the range [0, 2147483647]
      "%s-%s-%d", netdev->name, "TxRx", ri++);
      ^~~~~~~~~~
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1362:4: note: ‘snprintf’ output between 8 and 32 bytes into a destination of size 24
    snprintf(q_vector->name, sizeof(q_vector->name) - 1,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "%s-%s-%d", netdev->name, "TxRx", ri++);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Resolve this warning by making a couple of changes.
 - Don't reserve space for the null terminator.  Since snprintf adds the
   null terminator automatically, there is no need for us to reserve a byte
   for it.

 - Change a couple variables that can never be negative from int to
   unsigned int.

While we're making changes to the format string, move the constant strings
into the format string instead of providing them as specifiers.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31 04:45:14 -07:00
..
e1000 e1000: Omit private ndo_get_stats function 2017-04-20 16:18:45 -07:00
e1000e net: ethernet: update drivers to make both SW and HW TX timestamps 2017-05-21 13:37:32 -04:00
fm10k fm10k: do not enqueue mailbox when host not ready 2017-04-05 22:47:31 -07:00
i40e net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
i40evf i40evf: hide unused variable 2017-04-30 05:01:35 -07:00
igb net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
igbvf igbvf: Use net_device_stats from struct net_device 2017-04-20 16:32:45 -07:00
ixgb ixgb: Omit private ndo_get_stats function 2017-04-20 16:18:45 -07:00
ixgbe ixgbe: Resolve warnings for -Wimplicit-fallthrough 2017-05-31 04:43:47 -07:00
ixgbevf ixgbevf: Resolve truncation warning for q_vector->name 2017-05-31 04:45:14 -07:00
e100.c drivers: net: generalize napi_complete_done() 2017-01-30 15:10:42 -05:00
Kconfig i40e: Drop FCoE code from core driver files 2017-03-27 16:47:43 -07:00
Makefile fm10k: Add skeletal frame for Intel(R) FM10000 Ethernet Switch Host Interface Driver 2014-09-23 03:59:13 -07:00