[PATCH] sky2: ring distance optimization

Faster way to compute ring distance.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
Stephen Hemminger 2005-12-09 11:34:59 -08:00 committed by Jeff Garzik
parent f2e46561cc
commit 129372d052
1 changed files with 1 additions and 1 deletions

View File

@ -1039,7 +1039,7 @@ err_out:
/* 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 */