staging: speakup: remove jiffies comparison using time_after_eq()
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Sun, 21 Sep 2014 13:52:51 +0000 (19:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Sep 2014 20:31:36 +0000 (13:31 -0700)
This patch fixes checkpatch.pl warning in files of speakup
WARNING : Comparing jiffies is almost always wrong; prefer time_after,
time_before and friends

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/speakup_decext.c
drivers/staging/speakup/speakup_decpc.c
drivers/staging/speakup/synth.c

index 510ac97b097b3192c9211120e62bfac1812a3ee0..555029036dc2bb3dc32895ffdb5f51a8b34e0318 100644 (file)
@@ -204,7 +204,7 @@ static void do_catch_up(struct spk_synth *synth)
                else if (ch <= SPACE) {
                        if (!in_escape && strchr(",.!?;:", last))
                                spk_serial_out(PROCSPEECH);
-                       if (jiffies >= jiff_max) {
+                       if (time_after_eq(jiffies, jiff_max)) {
                                if (!in_escape)
                                        spk_serial_out(PROCSPEECH);
                                spin_lock_irqsave(&speakup_info.spinlock, flags);
index 693389e41ddaa3185f11d75e67ff16ed3fcbe47a..7c9c432e48d99fd11d71b6c2722eb36bd8fdef48 100644 (file)
@@ -420,7 +420,7 @@ static void do_catch_up(struct spk_synth *synth)
                else if (ch <= SPACE) {
                        if (!in_escape && strchr(",.!?;:", last))
                                dt_sendchar(PROCSPEECH);
-                       if (jiffies >= jiff_max) {
+                       if (time_after_eq(jiffies, jiff_max)) {
                                if (!in_escape)
                                        dt_sendchar(PROCSPEECH);
                                spin_lock_irqsave(&speakup_info.spinlock, flags);
index 4c47b6d06a9f4db995cf48c9793f31d024ae25fb..f3aa4239dc68c8e08225b29bd2ec9fca35848a65 100644 (file)
@@ -122,7 +122,7 @@ void spk_do_catch_up(struct spk_synth *synth)
                        schedule_timeout(msecs_to_jiffies(full_time_val));
                        continue;
                }
-               if ((jiffies >= jiff_max) && (ch == SPACE)) {
+               if (time_after_eq(jiffies, jiff_max) && (ch == SPACE)) {
                        spin_lock_irqsave(&speakup_info.spinlock, flags);
                        jiffy_delta_val = jiffy_delta->u.n.value;
                        delay_time_val = delay_time->u.n.value;