Re: [PATCH 2/6] firewire: isochronous and asynchronous I/O

Stefan Richter
2007-05-03T08:55:27Z

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
-=====-=-=== -=-= ---==