<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Marcelo Feitoza Parisi &lt;marcelo@feitoza.com.br&gt;

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

Signed-off-by: Marcelo Feitoza Parisi &lt;marcelo@feitoza.com.br&gt;
Signed-off-by: Domen Puncer &lt;domen@coderock.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 drivers/char/lp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/char/lp.c~drivers-char-lpc-use-of-the-time_after-macro drivers/char/lp.c
--- devel/drivers/char/lp.c~drivers-char-lpc-use-of-the-time_after-macro	2005-08-03 21:46:45.000000000 -0700
+++ devel-akpm/drivers/char/lp.c	2005-08-03 21:46:45.000000000 -0700
@@ -128,6 +128,7 @@
 #include &lt;linux/console.h&gt;
 #include &lt;linux/device.h&gt;
 #include &lt;linux/wait.h&gt;
+#include &lt;linux/jiffies.h&gt;
 
 #include &lt;linux/parport.h&gt;
 #undef LP_STATS
@@ -307,7 +308,7 @@ static ssize_t lp_write(struct file * fi
 			(LP_F(minor) &amp; LP_ABORT));
 
 #ifdef LP_STATS
-	if (jiffies-lp_table[minor].lastcall &gt; LP_TIME(minor))
+	if (time_after(jiffies, lp_table[minor].lastcall + LP_TIME(minor)))
 		lp_table[minor].runchars = 0;
 
 	lp_table[minor].lastcall = jiffies;
_
</pre></body></html>