mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 13/14] kernel/irq/spurious.c: Use time_* macros
@ 2008-02-14 15:36 S.Çağlar Onur
  2008-02-17 16:57 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: S.Çağlar Onur @ 2008-02-14 15:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Thomas Gleixner, 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

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
---
 kernel/irq/spurious.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index a6b2bc8..088dabb 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -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++;
-- 
1.5.3.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 13/14] kernel/irq/spurious.c: Use time_* macros
  2008-02-14 15:36 [PATCH 13/14] kernel/irq/spurious.c: Use time_* macros S.Çağlar Onur
@ 2008-02-17 16:57 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2008-02-17 16:57 UTC (permalink / raw)
  To: S.Çağlar Onur; +Cc: linux-kernel, Ingo Molnar

[-- Attachment #1: Type: TEXT/PLAIN, Size: 337 bytes --]

On Thu, 14 Feb 2008, S.Çağlar Onur wrote:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-17 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-14 15:36 [PATCH 13/14] kernel/irq/spurious.c: Use time_* macros S.Çağlar Onur
2008-02-17 16:57 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®