diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-12-09 11:34:59 -0800 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-12 15:27:20 -0500 |
commit | 129372d0524c9124d5693f63c1d3c1ce2e3714ce (patch) | |
tree | 725dc0b2a818e6a4d694ddbea9fb2f469f4adcec | |
parent | f2e46561cc1afa82b18b2fc6efc8510ec57c7d7d (diff) |
[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>
-rw-r--r-- | drivers/net/sky2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index eae270d8180..2dd46a05fb3 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -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 */ |