summaryrefslogtreecommitdiffstats
path: root/drivers/char/lp.c
diff options
context:
space:
mode:
authorMarcelo Feitoza Parisi <marcelo@feitoza.com.br>2005-09-10 09:26:57 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 19:06:31 +0200
commit96757701336365e30bea9fccdfac087338954e09 (patch)
tree4828b23c9023d215edeb818f0d7e94f456e3526a /drivers/char/lp.c
parent[PATCH] patch] remove sound/oss/skeleton.c (diff)
downloadlinux-96757701336365e30bea9fccdfac087338954e09.tar.xz
linux-96757701336365e30bea9fccdfac087338954e09.zip
[PATCH] drivers/char/lp.c : Use of the time_after() macro
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 <marcelo@feitoza.com.br> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/lp.c')
-rw-r--r--drivers/char/lp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 59eebe5a035f..2afb9038dbc5 100644
--- a/drivers/char/lp.c
+++ b/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 * file, const char __user * buf,
(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;