aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-09 14:34:59 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-12 15:27:20 -0500
commit129372d0524c9124d5693f63c1d3c1ce2e3714ce (patch)
tree725dc0b2a818e6a4d694ddbea9fb2f469f4adcec /drivers/net/sky2.c
parentf2e46561cc1afa82b18b2fc6efc8510ec57c7d7d (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>
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:
1039/* Modular subtraction in ring */ 1039/* Modular subtraction in ring */
1040static inline int tx_dist(unsigned tail, unsigned head) 1040static inline int tx_dist(unsigned tail, unsigned head)
1041{ 1041{
1042 return (head >= tail ? head : head + TX_RING_SIZE) - tail; 1042 return (head - tail) % TX_RING_SIZE;
1043} 1043}
1044 1044
1045/* Number of list elements available for next tx */ 1045/* Number of list elements available for next tx */