![]() | |||||||||||||
Messages in this thread |
Kristian Høgsberg wrote: > Christoph Hellwig wrote: [...] >>> + retval = fw_core_add_descriptor(&model_id_descriptor); >>> + BUG_ON(retval < 0); >> >> These kinds of bug checks look wrong. Either the operations >> can't fail in which case they should not return an error value >> or you should handle them properly. > > The fw_core_add_descriptor() checks that the descriptor block it's passed is > internally consistent and is used for blocks passed in from userspace too. In > these two cases, the blocks are static const arrays in the driver and if > fw_core_add_descriptor returns < 0 it's a bug in the driver. When you submitted it, I too wondered whether these BUG_ONs are correct (they are) and whether they are worth having (not so sure). A plus of a smaller stack is that we need less assertions to guard its integrity. :-) -- Stefan Richter -=====-=-=== -=-= ---== http://arcgraph.de/sr/ - 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: 2007-05-03 10:59 [from the cache] ©2003-2008 | |||||||||||||