Skip to contentSkip to conversation

kernel/irq/spurious.c: Use time_* macros

PATCH Applied S.Çağlar Onur 2 participants 2 messages Feb 14, 2008 – Feb 17, 2008 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 13/14 kernel/irq/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

Cc Ingo Molnar <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 kernel/irq/spurious.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/irq/spurious.c +2 -1
index a6b2bc8..088dabb 100644
@@ -6,6 +6,7 @@
  * This file contains spurious interrupt handling.
  */
 
+#include <linux/jiffies.h>
 #include <linux/irq.h>
 #include <linux/module.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
 		 * working systems
 		 */
-		if (jiffies - desc->last_unhandled > HZ/10)
+		if (time_after(jiffies, desc->last_unhandled + HZ/10))
 			desc->irqs_unhandled = 1;
 		else
 			desc->irqs_unhandled++;
Signature · 1 line
1.5.3.7
#1 lore raw
Quoted 3 lines · S.Çağlar Onur

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

Applied. Thanks,

tglx