]> err.no Git - linux-2.6/commitdiff
Input: drivers/char/keyboard.c - use time_after
authorJulia Lawall <julia@diku.dk>
Thu, 17 Apr 2008 13:28:25 +0000 (09:28 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 24 Apr 2008 17:24:54 +0000 (13:24 -0400)
The functions time_before, time_before_eq, time_after, and time_after_eq
are more robust for comparing jiffies against other values.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/char/keyboard.c

index 59608e341385d56ce3c70304a77480ff0abbe5b0..45806d27579ab8bbc13f94d2f6865fa0b9b5b9e9 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/input.h>
 #include <linux/reboot.h>
 #include <linux/notifier.h>
+#include <linux/jiffies.h>
 
 extern void ctrl_alt_del(void);
 
@@ -928,7 +929,8 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag)
        if (up_flag) {
                if (brl_timeout) {
                        if (!committing ||
-                           jiffies - releasestart > (brl_timeout * HZ) / 1000) {
+                           time_after(jiffies,
+                                      releasestart + msecs_to_jiffies(brl_timeout))) {
                                committing = pressed;
                                releasestart = jiffies;
                        }