ixgbevf: fix unused variable warning
Subsystems (3)
PATCH 1/1 ixgbevf: fix unused variable warning
The new ixgbevf_set_rx_buffer_len() function causes a harmless warnings in configurations with large page size:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function 'ixgbevf_set_rx_buffer_len':drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1758:15: error: unused variable 'max_frame' [-Werror=unused-variable]
This rephrases the code so that the compiler can see the use of that variable, making it slightly easier to read in the process.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +5 -5
@@ -1766,12 +1766,12 @@ static void ixgbevf_set_rx_buffer_len(struct ixgbevf_adapter *adapter,set_ring_build_skb_enabled (rx_ring); -#if (PAGE_SIZE <8192 ) -if (max_frame <=IXGBEVF_MAX_FRAME_BUILD_SKB ) -return ; +if (PAGE_SIZE <8192 ) { +if (max_frame <=IXGBEVF_MAX_FRAME_BUILD_SKB ) +return ; -set_ring_uses_large_buffer (rx_ring); -#endif +set_ring_uses_large_buffer (rx_ring); + } }/**
Signature · 1 line
2.9.0
Bowers
PATCH 1/1 ixgbevf: fix unused variable warning
Quoted 22 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Arnd Bergmann
Sent: Wednesday, February 28, 2018 3:18 PM
To: Kirsher, Jeffrey T <[email protected]>
Cc: Arnd Bergmann <[email protected]>; netdev at vger.kernel.org; linux- kernel at vger.kernel.org; intel-wired-lan at lists.osuosl.org; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [net-next PATCH] ixgbevf: fix unused variable warningThe new
ixgbevf_set_rx_buffer_len()function causes a harmless warnings in configurations with large page size:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function 'ixgbevf_set_rx_buffer_len':drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1758:15: error: unused variable 'max_frame' [-Werror=unused-variable]This rephrases the code so that the compiler can see the use of that variable, making it slightly easier to read in the process.
Quoted 6 lines
Fixes f15c5ba5b6cd ("ixgbevf: add support for using order 1 pages to receivelarge frames")
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 27 lines · Arnd Bergmann
The new
ixgbevf_set_rx_buffer_len()function causes a harmless warnings in configurations with large page size:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function 'ixgbevf_set_rx_buffer_len':drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1758:15: error: unused variable 'max_frame' [-Werror=unused-variable]This rephrases the code so that the compiler can see the use of that variable, making it slightly easier to read in the process.
Fixes f15c5ba5b6cd ("ixgbevf: add support for using order 1 pages to receive large frames")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1
-3@@ -1766,12 +1766,12 @@ static void ixgbevf_set_rx_buffer_len(struct ixgbevf_adapter *adapter,set_ring_build_skb_enabled (rx_ring); -#if (PAGE_SIZE <8192 ) -if (max_frame <=IXGBEVF_MAX_FRAME_BUILD_SKB ) -return ; +if (PAGE_SIZE <8192 ) {
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c static void ixgbevf_set_rx_buffer_len(struct ixgbevf_adapter *adapter, · line 1777
Quoted 10 lines
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +4
-2+if (max_frame <=IXGBEVF_MAX_FRAME_BUILD_SKB ) +return ; -set_ring_uses_large_buffer (rx_ring); -#endif +set_ring_uses_large_buffer (rx_ring); + } }/**
The fix looks good to me.