Browse Source

genirq: spurious.c: use time_* macros

The functions time_before, time_before_eq, time_after, and
time_after_eq are more robust for comparing jiffies against other
values.

So following patch implements usage of the time_after() macro, defined
at linux/jiffies.h, which deals with wrapping correctly

Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
S.Caglar Onur 17 years ago
parent
commit
188fd89d53
1 changed files with 2 additions and 1 deletions
  1. 2 1
      kernel/irq/spurious.c

+ 2 - 1
kernel/irq/spurious.c

@@ -6,6 +6,7 @@
  * This file contains spurious interrupt handling.
  * This file contains spurious interrupt handling.
  */
  */
 
 
+#include <linux/jiffies.h>
 #include <linux/irq.h>
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
 #include <linux/kallsyms.h>
@@ -179,7 +180,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
 		 * otherwise the couter becomes a doomsday timer for otherwise
 		 * otherwise the couter becomes a doomsday timer for otherwise
 		 * working systems
 		 * working systems
 		 */
 		 */
-		if (jiffies - desc->last_unhandled > HZ/10)
+		if (time_after(jiffies, desc->last_unhandled + HZ/10))
 			desc->irqs_unhandled = 1;
 			desc->irqs_unhandled = 1;
 		else
 		else
 			desc->irqs_unhandled++;
 			desc->irqs_unhandled++;