diff options
-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 */ |