On Saturday 17 May 2008, Trent Piepho wrote: > > > Passing NULL to the current functions would just crash, it wouldn't > > > morph anything. > > > > That's only if you assume an MMU set up to cause oopsing on reference > > to the first and last pages of memory. Not the best of assumptions... > > Maybe BUG_ON(!client) would be better? It seems more likely to catch > a programming error.
BUG_ON() is almost always the wrong answer though ... it's only appropriate when there's no way for the system to continue. And in fact, here it's *not* a bug... Passing NULL around is more often OK than not. Example, it's expected that passing it to a "free this object" routine will work, saving callers a NULL check. Similarly, refcount calls. _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
