[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080711135143.23e26a7c@infradead.org>
Date: Fri, 11 Jul 2008 13:51:43 -0700
From: Arjan van de Ven <arjan@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: Re: [patch 2/17] Add a WARN() macro that acts like WARN_ON()+printk
On Fri, 11 Jul 2008 12:19:49 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Tue, 8 Jul 2008 09:40:23 -0700 Arjan van de Ven
> <arjan@...radead.org> wrote:
>
> > From: Arjan van de Ven <arjan@...ux.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.
WARN_ON_ONCE() doesn't take printk arguments. So WARN_ONCE() is
WAR_ON_ONCE() with printk arguments...
--
If you want to reach me at my work email, use arjan@...ux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists