Faster way to compute ring distance.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- sky2-netdev.orig/drivers/net/sky2.c
+++ sky2-netdev/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 */

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to