gve: fix unused variable/label warnings

On unusual page sizes, we get harmless warnings:

drivers/net/ethernet/google/gve/gve_rx.c:283:6: error: unused variable 'pagecount' [-Werror,-Wunused-variable]
drivers/net/ethernet/google/gve/gve_rx.c:336:1: error: unused label 'have_skb' [-Werror,-Wunused-label]

Change the preprocessor #if to regular if() to avoid this.

Fixes: f5cedc84a3 ("gve: Add transmit and receive support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arnd Bergmann
2019-07-08 14:43:39 +02:00
committed by David S. Miller
parent 05cfee98c8
commit 0287f9ed16

View File

@@ -297,7 +297,7 @@ static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc,
* it so that we can return it to the device.
*/
#if PAGE_SIZE == 4096
if (PAGE_SIZE == 4096) {
if (len <= priv->rx_copybreak) {
/* Just copy small packets */
skb = gve_rx_copy(dev, napi, page_info, len);
@@ -329,9 +329,9 @@ static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc,
WARN(pagecount < 1, "Pagecount should never be < 1");
return false;
}
#else
} else {
skb = gve_rx_copy(dev, napi, page_info, len);
#endif
}
have_skb:
/* We didn't manage to allocate an skb but we haven't had any