Commit 96757701 authored by Marcelo Feitoza Parisi's avatar Marcelo Feitoza Parisi Committed by Linus Torvalds

[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: default avatarMarcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 82b44429
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/jiffies.h>
#include <linux/parport.h> #include <linux/parport.h>
#undef LP_STATS #undef LP_STATS
...@@ -307,7 +308,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf, ...@@ -307,7 +308,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
(LP_F(minor) & LP_ABORT)); (LP_F(minor) & LP_ABORT));
#ifdef LP_STATS #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].runchars = 0;
lp_table[minor].lastcall = jiffies; lp_table[minor].lastcall = jiffies;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment