Skip to content

Commit 6a74af7

Browse files
Russell King (Oracle)gregkh
authored andcommitted
net: stmmac: avoid shadowing global buf_sz
[ Upstream commit 876cfb2 ] stmmac_rx() declares a local variable named "buf_sz" but there is also a global variable for a module parameter which is called the same. To avoid confusion, rename the local variable. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Furong Xu <0x1207@gmail.com> Link: https://patch.msgid.link/E1tpswi-005U6C-Py@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 0bb05e6 ("net: stmmac: Prevent NULL deref when RX memory exhausted") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2adbfca commit 6a74af7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5279,10 +5279,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
52795279
struct sk_buff *skb = NULL;
52805280
struct stmmac_xdp_buff ctx;
52815281
int xdp_status = 0;
5282-
int buf_sz;
5282+
int bufsz;
52835283

52845284
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
5285-
buf_sz = DIV_ROUND_UP(priv->dma_conf.dma_buf_sz, PAGE_SIZE) * PAGE_SIZE;
5285+
bufsz = DIV_ROUND_UP(priv->dma_conf.dma_buf_sz, PAGE_SIZE) * PAGE_SIZE;
52865286
limit = min(priv->dma_conf.dma_rx_size - 1, (unsigned int)limit);
52875287

52885288
if (netif_msg_rx_status(priv)) {
@@ -5397,7 +5397,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
53975397
dma_sync_single_for_cpu(priv->device, buf->addr,
53985398
buf1_len, dma_dir);
53995399

5400-
xdp_init_buff(&ctx.xdp, buf_sz, &rx_q->xdp_rxq);
5400+
xdp_init_buff(&ctx.xdp, bufsz, &rx_q->xdp_rxq);
54015401
xdp_prepare_buff(&ctx.xdp, page_address(buf->page),
54025402
buf->page_offset, buf1_len, true);
54035403

0 commit comments

Comments
 (0)