diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-12-09 14:34:59 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-12 15:27:20 -0500 |
commit | 129372d0524c9124d5693f63c1d3c1ce2e3714ce (patch) | |
tree | 725dc0b2a818e6a4d694ddbea9fb2f469f4adcec /drivers | |
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>
Diffstat (limited to 'drivers')
-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 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 */ |
1040 | static inline int tx_dist(unsigned tail, unsigned head) | 1040 | static 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 */ |