diff options
author | Marcelo Feitoza Parisi <marcelo@feitoza.com.br> | 2005-09-10 03:26:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 13:06:31 -0400 |
commit | 96757701336365e30bea9fccdfac087338954e09 (patch) | |
tree | 4828b23c9023d215edeb818f0d7e94f456e3526a /drivers/char | |
parent | 82b44429e0c8a8fec8f36e98a725f516227dabc0 (diff) |
[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')
-rw-r--r-- | drivers/char/lp.c | 3 |
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 @@ | |||
128 | #include <linux/console.h> | 128 | #include <linux/console.h> |
129 | #include <linux/device.h> | 129 | #include <linux/device.h> |
130 | #include <linux/wait.h> | 130 | #include <linux/wait.h> |
131 | #include <linux/jiffies.h> | ||
131 | 132 | ||
132 | #include <linux/parport.h> | 133 | #include <linux/parport.h> |
133 | #undef LP_STATS | 134 | #undef LP_STATS |
@@ -307,7 +308,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf, | |||
307 | (LP_F(minor) & LP_ABORT)); | 308 | (LP_F(minor) & LP_ABORT)); |
308 | 309 | ||
309 | #ifdef LP_STATS | 310 | #ifdef LP_STATS |
310 | if (jiffies-lp_table[minor].lastcall > LP_TIME(minor)) | 311 | if (time_after(jiffies, lp_table[minor].lastcall + LP_TIME(minor))) |
311 | lp_table[minor].runchars = 0; | 312 | lp_table[minor].runchars = 0; |
312 | 313 | ||
313 | lp_table[minor].lastcall = jiffies; | 314 | lp_table[minor].lastcall = jiffies; |