Messages in this thread |  | | Date | Tue, 10 Sep 2002 12:29:53 -0700 (PDT) | Subject | Re: [linux-usb-devel] Re: [BK PATCH] USB changes for 2.5.34 | From | "David S. Miller" <> |
| |
The way I see it, FATAL() is the only thing that really should escape from my local tree and end up ever being a permanent fixture of the code that is in the standard sources.
The other WARN/DEBUG variants seem, at least to me, to be a prime candidate for unmaintained clutter.
Also, another big win of OHSHIT(), or BUG_ON() or whatever you want to call it is that the thing is so cheap. Both in terms of space (no strings, no calls with varags arguments, 1 instruction) and time (a cycle or two).
With these DEBUG/WARN/FATAL things with the strings, I am much less likely to ever add them to code I am writing. Simply because I'll say "hmmm that's expensive, the check isn't that important"
On the other hand I do recognize your user side arguments.
But to counter the "BUG with locks freezes box" argument, 9 times out of 10 the thing that you are BUG()'ing on will freeze up the box anyways with the same locks held when some other thread of execution derefences some bad pointer created by, or as a side effect of, the erroneous state. - 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/
|  |