[patch 68/83] x86: HPET: convert WARN_ON to WARN_ON_ONCE

Greg KH
2008-12-11T19:42:46Z

[-- Attachment #1: x86-hpet-convert-warn_on-to-warn_on_once.patch --]
[-- Type: text/plain, Size: 1041 bytes --]

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Matt Fleming <mjf@gentoo.org>

commit 1de5b0854623d30d01d72cd4ea323eb5f39d1f16 upstream.

It is possible to flood the console with call traces if the WARN_ON
condition is true because of the frequency with which this function is
called.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Cc: mingo@elte.hu
Cc: venkatesh.pallipadi@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
arch/x86/kernel/hpet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -283,7 +283,7 @@ static int hpet_legacy_next_event(unsign
* what we wrote hit the chip before we compare it to the
* counter.
*/
- WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt);
+ WARN_ON_ONCE((u32)hpet_readl(HPET_T0_CMP) != cnt);

return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
}