lkml.org 
[lkml]   [2008]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/17] Add a WARN() macro that acts like WARN_ON()+printk
On Tue, 8 Jul 2008 09:40:23 -0700 Arjan van de Ven <arjan@infradead.org> wrote:

> From: Arjan van de Ven <arjan@linux.intel.com>
>
> Add a WARN() macro that acts like WARN_ON(), with the added feature that it
> takes a printk like argument that is printed as part of the warning message.
>

Apart from a little whitespace tweak, this is identical to what I already had.

> +#define WARN_ONCE(condition, format...) ({ \
> + static int __warned; \
> + int __ret_warn_once = !!(condition); \
> + \
> + if (unlikely(__ret_warn_once)) \
> + if (WARN(!__warned, format)) \
> + __warned = 1; \
> + unlikely(__ret_warn_once); \
> +})

Except it adds this operation, without describing it at all in the
changelog.

Is this some brainfart, or am I missing something? I can see some sense in
a WARN_ONCE(format...), but not in a WARN_ONCE() which takes a `condition'
and should be called WARN_ON_ONCE(), which we already have.

As it appears that you didn't add any users of WARN_ONCE(), I shall
delicately step away from this patch.

More care, please?


\
 
 \ /
  Last update: 2008-07-11 21:27    [W:0.119 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site