From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Subject: [KJ] [PATCH] drivers/net/shaper.c : Use of the time_before() and time_after() macros


Use of the time_before() and time_after()  macros, defined at linux/jiffies.h,
which deal with wrapping correctly and are nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

---
 shaper.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Index: quilt/drivers/net/shaper.c
===================================================================
--- quilt.orig/drivers/net/shaper.c
+++ quilt/drivers/net/shaper.c
@@ -161,7 +161,8 @@ static int shaper_start_xmit(struct sk_b
  	while(ptr && ptr!=(struct sk_buff *)&shaper->sendq)
  	{
  		if(ptr->pri<skb->pri 
- 			&& jiffies - SHAPERCB(ptr)->shapeclock < SHAPER_MAXSLIP)
+ 			&& time_before(jiffies, SHAPERCB(ptr)->shapeclock
+			       + SHAPER_MAXSLIP))
  		{
  			struct sk_buff *tmp=ptr->prev;
 
@@ -214,7 +215,8 @@ static int shaper_start_xmit(struct sk_b
 		/*
 		 *	Queue over time. Spill packet.
 		 */
-		if(SHAPERCB(skb)->shapeclock-jiffies > SHAPER_LATENCY) {
+		if(time_after(SHAPERCB(skb)->shapeclock, jiffies
+					+ SHAPER_LATENCY)) {
 			dev_kfree_skb(skb);
 			shaper->stats.tx_dropped++;
 		} else
