lkml.org 
[lkml]   [2007]   [Dec]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 15 Dec 2007 14:04:49 +0800
FromHerbert Xu <>
SubjectRe: [PATCH] Make WARN_ON/WARN_ON_ONCE no-ops when CONFIG_BUG is off
On Fri, Dec 14, 2007 at 11:52:18PM -0600, Matt Mackall wrote:
>
> No. The code as written above should reduce to:
> 
> 	if (val == NULL)
> 		return -EFAULT;
> 
> If I hadn't wanted to return -EFAULT in this case, I would have just written:
> 
> 	WARN_ON(val == NULL);

Well the only reason I introduced

	if (WARN_ON)
is so that what would otherwise be a BUG_ON condition would have
a chance to get written to disk when invoked from an IRQ handler.

> I don't want code that was running safely (ie returning -EFAULT) to
> start crashing the system just because I've, say, disabled printk.
> That's creating an obnoxious heisenbug.

I'm disappointed that it has been used in ways that it shouldn't
have been.

I suppose we'll have to either introduce a new primitive or just
go back to using BUG_ON.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2007-12-15 07:07    [from the cache]
©2003-2008