Skip to content

Commit

Permalink
genirq: spurious.c: use time_* macros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
S.Caglar Onur authored and Thomas Gleixner committed Feb 19, 2008
1 parent 9a4c854 commit 188fd89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/irq/spurious.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit 188fd89

Please sign in to comment.