Oh? I remember many people having objections against assert.
Personally I like BUG_ON() as is and it helped me already
catching a lot of bugs in my own code and removed the need for
several conditions and cleanup code for situation, that happen only
with wrong arguments/corruption and are bugs instead of user
stupidity.
BUG() is usally used, when we need to print much more information
about the error (like dumping some variables, which have wrong
values). In these cases a BUG_PRINTK() would be much more
useful, since most users of BUG() use printk before and only want
to save cleanup code for "impossible" conditions.
Or at least have a variant of BUG(), which has only triggers the
code path aborting, without printing filename/line_no (because
our own debug statements did this already).
Regards
Ingo Oeser
-- Science is what we can tell a computer. Art is everything else. --- D.E.Knuth - 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/