提交 129372d0 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] sky2: ring distance optimization

Faster way to compute ring distance.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 f2e46561
......@@ -1039,7 +1039,7 @@ static int sky2_up(struct net_device *dev)
/* Modular subtraction in ring */
static inline int tx_dist(unsigned tail, unsigned head)
{
return (head >= tail ? head : head + TX_RING_SIZE) - tail;
return (head - tail) % TX_RING_SIZE;
}
/* Number of list elements available for next tx */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册