lkml.org 
[lkml]   [2004]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2.6.6] bootmem.c cleanup
Date
Followup to:  <20040514133353.236acf3a.akpm@osdl.org>
By author: Andrew Morton <akpm@osdl.org>
In newsgroup: linux.dev.kernel
>
> Michael Buesch <mbuesch@freenet.de> wrote:
> >
> > - if (!test_and_clear_bit(i, bdata->node_bootmem_map))
> > - BUG();
> > + BUG_ON(!test_and_clear_bit(i, bdata->node_bootmem_map));
>
> Please don't put expressions whihc actually change state inside BUG_ON().
> Someone may decide to make BUG_ON() a no-op to save space.
>
> I'm not aware of anyone actually trying that, but it's a good objective.
>

If so they should make it:

#define BUG_ON(x) ((void)(x))

.. which preserves side effects while generating no object code for a
side-effect-free expression.

The only reason for the cast to (void) at all is to keep gcc from
complaining about an ignored expression.

-hpa
-
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: 2005-03-22 14:03    [W:0.035 / U:4.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site