linux_dsm_epyc7002/drivers/net/ethernet/intel/ixgbe
Tony Nguyen e61e4c8b90 ixgbe: 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/ixgbe/ixgbe_main.c: In function ‘ixgbe_open’:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3118: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/ixgbe/ixgbe_main.c:3118:6: note: directive argument in the range [0, 2147483647]
      "%s-%s-%d", netdev->name, "TxRx", ri++);
      ^~~~~~~~~~
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3117: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:39:47 -07:00
..
ixgbe_82598.c ixgbe: Remove unused firmware version functions and method 2017-01-03 13:03:38 -08:00
ixgbe_82599.c scripts/spelling.txt: add "applys" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
ixgbe_common.c ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] support 2017-05-31 04:31:43 -07:00
ixgbe_common.h ixgbe: Implement firmware interface to access some PHYs 2017-01-03 13:03:39 -08:00
ixgbe_dcb_82598.c ixgbe: use BIT() macro 2016-04-25 04:15:11 -07:00
ixgbe_dcb_82598.h
ixgbe_dcb_82599.c ixgbe: use BIT() macro 2016-04-25 04:15:11 -07:00
ixgbe_dcb_82599.h
ixgbe_dcb_nl.c ixgbe: prefix Data Center Bridge ops struct 2017-02-16 04:02:44 -08:00
ixgbe_dcb.c ixgbe: use BIT() macro 2016-04-25 04:15:11 -07:00
ixgbe_dcb.h
ixgbe_debugfs.c
ixgbe_ethtool.c ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] support 2017-05-31 04:31:43 -07:00
ixgbe_fcoe.c ixgbe: Fix MDD events generated when FCoE+SRIOV are enabled 2016-01-08 04:15:00 -08:00
ixgbe_fcoe.h
ixgbe_lib.c ixgbe: add support for XDP_TX action 2017-04-29 19:58:07 -07:00
ixgbe_main.c ixgbe: Resolve truncation warning for q_vector->name 2017-05-31 04:39:47 -07:00
ixgbe_mbx.c ixgbe: use BIT() macro 2016-04-25 04:15:11 -07:00
ixgbe_mbx.h ixgbe: Add PF support for VF promiscuous mode 2017-01-03 13:03:40 -08:00
ixgbe_model.h ixgbe: Fix deleting link filters for cls_u32 offloads 2016-06-29 10:05:24 -07:00
ixgbe_phy.c ixgbe: Remove driver config for KX4 PHY 2017-04-18 13:04:09 -07:00
ixgbe_phy.h ixgbe: Remove unused firmware version functions and method 2017-01-03 13:03:38 -08:00
ixgbe_ptp.c net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
ixgbe_sriov.c ixgbe: Add error checking to setting VF MAC 2017-05-31 04:38:23 -07:00
ixgbe_sriov.h ixgbe: do not use adapter->num_vfs when setting VFs via module parameter 2017-04-18 13:25:30 -07:00
ixgbe_sysfs.c
ixgbe_type.h ixgbe: Add 1000Base-T device based on X550EM_X MAC 2017-04-29 20:01:03 -07:00
ixgbe_x540.c ixgbe: Acquire PHY semaphore before device reset 2017-04-28 19:02:31 -07:00
ixgbe_x540.h ixgbe: Place SWFW semaphore in known valid state at probe 2016-04-04 17:44:50 -07:00
ixgbe_x550.c ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] support 2017-05-31 04:31:43 -07:00
ixgbe.h ixgbe: Check for RSS key before setting value 2017-04-29 20:01:04 -07:00
Makefile