Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0287f9ed authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller
Browse files

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: f5cedc84 ("gve: Add transmit and receive support")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05cfee98
Loading
Loading
Loading
Loading
+33 −33
Original line number Diff line number Diff line
@@ -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