On Mon, 29 May 2006 23:23:28 +0200
Ingo Molnar <[email protected]> wrote:
> add WARN_ON_ONCE(cond) to print once-per-bootup messages.
>
> Signed-off-by: Ingo Molnar <[email protected]>
> Signed-off-by: Arjan van de Ven <[email protected]>
> ---
> include/asm-generic/bug.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> Index: linux/include/asm-generic/bug.h
> ===================================================================
> --- linux.orig/include/asm-generic/bug.h
> +++ linux/include/asm-generic/bug.h
> @@ -44,4 +44,17 @@
> # define WARN_ON_SMP(x) do { } while (0)
> #endif
>
> +#define WARN_ON_ONCE(condition) \
> +({ \
> + static int __warn_once = 1; \
> + int __ret = 0; \
> + \
> + if (unlikely(__warn_once && (condition))) { \
> + __warn_once = 0; \
> + WARN_ON(1); \
> + __ret = 1; \
> + } \
> + __ret; \
> +})
> +
> #endif
I'll queue this for mainline inclusion.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]