Skip to content

Commit

Permalink
[PATCH] sky2: ring distance optimization
Browse files Browse the repository at this point in the history
Faster way to compute ring distance.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Dec 12, 2005
1 parent f2e4656 commit 129372d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ static int sky2_up(struct net_device *dev)
/* 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 */
Expand Down

0 comments on commit 129372d

Please sign in to comment.