summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-09 11:34:59 -0800
committerJeff Garzik <jgarzik@pobox.com>2005-12-12 15:27:20 -0500
commit129372d0524c9124d5693f63c1d3c1ce2e3714ce (patch)
tree725dc0b2a818e6a4d694ddbea9fb2f469f4adcec /drivers/net
parentf2e46561cc1afa82b18b2fc6efc8510ec57c7d7d (diff)
downloadop-kernel-dev-129372d0524c9124d5693f63c1d3c1ce2e3714ce.zip
op-kernel-dev-129372d0524c9124d5693f63c1d3c1ce2e3714ce.tar.gz
[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')
-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 eae270d..2dd46a0 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 */
OpenPOWER on IntegriCloud