Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: drivers/char/keyboard.c - use time_after

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>

authored by

Julia Lawall and committed by
Dmitry Torokhov
b39b0440 81e329cd

+3 -1
+3 -1
drivers/char/keyboard.c
··· 42 42 #include <linux/input.h> 43 43 #include <linux/reboot.h> 44 44 #include <linux/notifier.h> 45 + #include <linux/jiffies.h> 45 46 46 47 extern void ctrl_alt_del(void); 47 48 ··· 929 928 if (up_flag) { 930 929 if (brl_timeout) { 931 930 if (!committing || 932 - jiffies - releasestart > (brl_timeout * HZ) / 1000) { 931 + time_after(jiffies, 932 + releasestart + msecs_to_jiffies(brl_timeout))) { 933 933 committing = pressed; 934 934 releasestart = jiffies; 935 935 }