From: Marcelo Feitoza Parisi Date: Sat, 10 Sep 2005 07:26:57 +0000 (-0700) Subject: [PATCH] drivers/char/lp.c : Use of the time_after() macro X-Git-Tag: upstream/snapshot3+hdmi~46023 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96757701336365e30bea9fccdfac087338954e09;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [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 Signed-off-by: Domen Puncer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 59eebe5..2afb903 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -128,6 +128,7 @@ #include #include #include +#include #include #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;