Commit 129372d0 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] sky2: ring distance optimization

Faster way to compute ring distance.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment