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:

committed by
David S. Miller

parent
05cfee98c8
commit
0287f9ed16
@@ -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.
|
* it so that we can return it to the device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if PAGE_SIZE == 4096
|
if (PAGE_SIZE == 4096) {
|
||||||
if (len <= priv->rx_copybreak) {
|
if (len <= priv->rx_copybreak) {
|
||||||
/* Just copy small packets */
|
/* Just copy small packets */
|
||||||
skb = gve_rx_copy(dev, napi, page_info, len);
|
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");
|
WARN(pagecount < 1, "Pagecount should never be < 1");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
skb = gve_rx_copy(dev, napi, page_info, len);
|
skb = gve_rx_copy(dev, napi, page_info, len);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
have_skb:
|
have_skb:
|
||||||
/* We didn't manage to allocate an skb but we haven't had any
|
/* We didn't manage to allocate an skb but we haven't had any
|
||||||
|
Reference in New Issue
Block a user