Subject: [PATCH 11/12] sky2: avoid divide in receive path

From: Stephen Hemminger <[email-masked]>
Date: Wed, 29 Aug 2007 12:58:20 -0700

Avoid divide (modulus) in receive buffer handling path.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/drivers/net/sky2.c	2007-08-29 11:41:23.000000000 -0700
+++ b/drivers/net/sky2.c	2007-08-29 11:45:00.000000000 -0700
@@ -2140,7 +2140,8 @@ static struct sk_buff *sky2_receive(stru
 		printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n",
 		       dev->name, sky2->rx_next, status, length);
 
-	sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
+	if (++sky2->rx_next >= sky2->rx_pending)
+		sky2->rx_next = 0;
 	prefetch(sky2->rx_ring + sky2->rx_next);
 
 	if (status & GMR_FS_ANY_ERR)

-- 
Stephen Hemminger <[email-masked]>