public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/5] drivers/char/lp.c : Use of the time_after() macro
@ 2005-07-31 11:12 domen
  0 siblings, 0 replies; only message in thread
From: domen @ 2005-07-31 11:12 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Marcelo Feitoza Parisi, domen

[-- Attachment #1: time_after-drivers_char_lp --]
[-- Type: text/plain, Size: 1009 bytes --]

From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>



Use of the time_after() macro, 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>
Signed-off-by: Domen Puncer <domen@coderock.org>

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

Index: quilt/drivers/char/lp.c
===================================================================
--- quilt.orig/drivers/char/lp.c
+++ quilt/drivers/char/lp.c
@@ -128,6 +128,7 @@
 #include <linux/console.h>
 #include <linux/device.h>
 #include <linux/wait.h>
+#include <linux/jiffies.h>
 
 #include <linux/parport.h>
 #undef LP_STATS
@@ -307,7 +308,7 @@ static ssize_t lp_write(struct file * fi
 			(LP_F(minor) & LP_ABORT));
 
 #ifdef LP_STATS
-	if (jiffies-lp_table[minor].lastcall > LP_TIME(minor))
+	if (time_after(jiffies, lp_table[minor].lastcall + LP_TIME(minor)))
 		lp_table[minor].runchars = 0;
 
 	lp_table[minor].lastcall = jiffies;

--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-31 11:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-31 11:12 [patch 1/5] drivers/char/lp.c : Use of the time_after() macro domen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox