Skip to contentSkip to conversation

staging: speakup: main.c - use time_after()

PATCH In review Anil Belur 2 participants 2 messages Jul 1, 2014 – Jul 8, 2014 Staging

lore
Share & tools
lore

Anil Belur

author
#0 lore raw

PATCH 1/1 staging: speakup: main.c - use time_after()

From: Anil Belur <[email protected]>

- this patch fixes jiffies comparision with a safer function to prevent any overflows

---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/main.c +1 -1
index 7de79d5..0cd3cdb 100644
@@ -2067,7 +2067,7 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 			if (up_flag)
 				goto out;
 			if (last_keycode == keycode &&
-			    last_spk_jiffy + MAX_DELAY > jiffies) {
+			    time_after(last_spk_jiffy + MAX_DELAY, jiffies)) {
 				spk_close_press = 1;
 				offset = spk_shift_table[shift_info + 32];
 				/* double press? */
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 9 lines · Anil Belur

From: Anil Belur <[email protected]>

- this patch fixes jiffies comparision with a safer function to prevent any overflows

---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This change is already in my tree, what branch are you working against?

greg k-h