On Wed, Oct 30, 2013 at 06:36:21PM +0100, Takashi Iwai wrote:
Mark Brown wrote:
On Wed, Oct 30, 2013 at 08:35:04AM +0100, Takashi Iwai wrote:
- if (channel < 0)
BUG_ON(channel > 1);return channel;
This doesn't seem to fit in well with the adjacent code - the handling of out of bounds data isn't consistent though it looks like they're both doing essentially the same thing here.
Actually BUG_ON(channel > 1) is a pretty stupid line and should be removed. You'll see that this never happens if you read the code.
Yeah, but then nor does a return of less than zero...
Overall, this driver has way too many BUG_ON() without considerations. Such BUT_ON()'s are worse than nothing, IMO.
Yeah, I'm ambivalent. I think they're not too bad if it's about a fairly small part of the driver agreeing with itself which is the case here.