summaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-09 20:34:59 +0100
committerJeff Garzik <jgarzik@pobox.com>2005-12-12 21:27:20 +0100
commit129372d0524c9124d5693f63c1d3c1ce2e3714ce (patch)
tree725dc0b2a818e6a4d694ddbea9fb2f469f4adcec /drivers/net/sky2.c
parent[PATCH] sky2: no irq disable needed during tx (diff)
downloadlinux-129372d0524c9124d5693f63c1d3c1ce2e3714ce.tar.xz
linux-129372d0524c9124d5693f63c1d3c1ce2e3714ce.zip
[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>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index eae270d81808..2dd46a05fb30 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 */