• Florian Fainelli's avatar
    e1000e: Fix -Wformat-truncation warnings · 135e7245
    Florian Fainelli authored
    Provide precision hints to snprintf() since we know the destination
    buffer size of the RX/TX ring names are IFNAMSIZ + 5 - 1. This fixes the
    following warnings:
    
    drivers/net/ethernet/intel/e1000e/netdev.c: In function
    'e1000_request_msix':
    drivers/net/ethernet/intel/e1000e/netdev.c:2109:13: warning: 'snprintf'
    output may be truncated before the last format character
    [-Wformat-truncation=]
         "%s-rx-0", netdev->name);
                 ^
    drivers/net/ethernet/intel/e1000e/netdev.c:2107:3: note: 'snprintf'
    output between 6 and 21 bytes into a destination of size 20
       snprintf(adapter->rx_ring->name,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         sizeof(adapter->rx_ring->name) - 1,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "%s-rx-0", netdev->name);
         ~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/net/ethernet/intel/e1000e/netdev.c:2125:13: warning: 'snprintf'
    output may be truncated before the last format character
    [-Wformat-truncation=]
         "%s-tx-0", netdev->name);
                 ^
    drivers/net/ethernet/intel/e1000e/netdev.c:2123:3: note: 'snprintf'
    output between 6 and 21 bytes into a destination of size 20
       snprintf(adapter->tx_ring->name,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         sizeof(adapter->tx_ring->name) - 1,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "%s-tx-0", netdev->name);
         ~~~~~~~~~~~~~~~~~~~~~~~~
    Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    135e7245
netdev.c 214 KB