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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux