]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40evf: hide unused variable
authorArnd Bergmann <arnd@arndb.de>
Wed, 19 Apr 2017 17:29:48 +0000 (19:29 +0200)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:23 +0000 (14:15 -0700)
On architectures with larger pages, we get a warning about an unused variable:

drivers/net/ethernet/intel/i40evf/i40evf_main.c: In function 'i40evf_configure_rx':
drivers/net/ethernet/intel/i40evf/i40evf_main.c:690:21: error: unused variable 'netdev' [-Werror=unused-variable]

This moves the declaration into the #ifdef to avoid the warning.

Fixes: dab86afdbbd1 ("i40e/i40evf: Change the way we limit the maximum frame size for Rx")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 3dfc3eb581645bc503c7940861f494a0d75615da)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 522e4f48183f230c967fecab88f484e5c12985a8..ef76ddb7ede16295b1853be2a045a3d40b0bae63 100644 (file)
@@ -696,13 +696,13 @@ static void i40evf_configure_tx(struct i40evf_adapter *adapter)
 static void i40evf_configure_rx(struct i40evf_adapter *adapter)
 {
        unsigned int rx_buf_len = I40E_RXBUFFER_2048;
-       struct net_device *netdev = adapter->netdev;
        struct i40e_hw *hw = &adapter->hw;
        int i;
 
        /* Legacy Rx will always default to a 2048 buffer size. */
 #if (PAGE_SIZE < 8192)
        if (!(adapter->flags & I40EVF_FLAG_LEGACY_RX)) {
+               struct net_device *netdev = adapter->netdev;
                /* We use a 1536 buffer size for configurations with
                 * standard Ethernet mtu.  On x86 this gives us enough room
                 * for shared info and 192 bytes of padding.