* [KJ] [PATCH] drivers/net/shaper.c : Use of the time_before() and
@ 2005-07-16 7:22 Marcelo Feitoza Parisi
0 siblings, 0 replies; only message in thread
From: Marcelo Feitoza Parisi @ 2005-07-16 7:22 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: shaper.patch --]
[-- Type: text/x-patch, Size: 912 bytes --]
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>
--- linux/drivers/net/shaper.c 2005-07-13 17:52:19.000000000 -0300
+++ linux-kj/drivers/net/shaper.c 2005-07-16 01:46:18.835005176 -0300
@@ -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
[-- Attachment #3: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-07-16 7:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16 7:22 [KJ] [PATCH] drivers/net/shaper.c : Use of the time_before() and Marcelo Feitoza Parisi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.