提交 21d3515c 编写于 作者: B Ben Shelton 提交者: David S. Miller

net/macb: Factor out one-time assignment from loop

In 02c958dd (net/macb: add TX multiqueue support for gem), the
initialization of tx_head and tx_tail in macb_init_rings() was moved
inside the loop that iterates over each element in the ring.  Since
tx_head and tx_tail only need to be assigned once, move them back out of
the loop.
Signed-off-by: NBen Shelton <ben.shelton@ni.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 79930f58
......@@ -1473,9 +1473,9 @@ static void macb_init_rings(struct macb *bp)
for (i = 0; i < TX_RING_SIZE; i++) {
bp->queues[0].tx_ring[i].addr = 0;
bp->queues[0].tx_ring[i].ctrl = MACB_BIT(TX_USED);
bp->queues[0].tx_head = 0;
bp->queues[0].tx_tail = 0;
}
bp->queues[0].tx_head = 0;
bp->queues[0].tx_tail = 0;
bp->queues[0].tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
bp->rx_tail = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册