Skip to contentSkip to conversation

drivers/net/shaper.c : Use of the time_before() and

PATCH New Marcelo Feitoza Parisi 1 participant 1 message Jul 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/shaper.c : Use of the time_before() and

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

drivers/net/shaper.c +4 -2
@@ -161,7 +161,8 @@
  	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 @@
 		/*
 		 *	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

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors