lkml.org 
[lkml]   [2006]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 05/61] lock validator: introduce WARN_ON_ONCE(cond)
    From: Ingo Molnar <mingo@elte.hu>

    add WARN_ON_ONCE(cond) to print once-per-bootup messages.

    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
    ---
    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-05-29 23:49    [W:4.303 / U:0.228 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site