From ee6f2a098346a6a59391d9272591b1127f57b4e0 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 25 Jun 2006 05:48:09 -0700 Subject: [PATCH] --- yaml --- r: 29729 b: refs/heads/master c: 74bb6a09b2e1e69d91eb6069eb4a7f0c06b84812 h: refs/heads/master i: 29727: 86af5e0572061b3cfad0733b28224ec0c00be356 v: v3 --- [refs] | 2 +- trunk/include/asm-generic/bug.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9f64d9e4620b..00025a0f10f2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 69755652c92106855b4b096b7c2935b59e6252c6 +refs/heads/master: 74bb6a09b2e1e69d91eb6069eb4a7f0c06b84812 diff --git a/trunk/include/asm-generic/bug.h b/trunk/include/asm-generic/bug.h index 0cd9711895fa..845cb67ad8ea 100644 --- a/trunk/include/asm-generic/bug.h +++ b/trunk/include/asm-generic/bug.h @@ -38,4 +38,17 @@ #endif #endif +#define WARN_ON_ONCE(condition) \ +({ \ + static int __warn_once = 1; \ + int __ret = 0; \ + \ + if (unlikely((condition) && __warn_once)) { \ + __warn_once = 0; \ + WARN_ON(1); \ + __ret = 1; \ + } \ + __ret; \ +}) + #endif