Re: [PATCH] staging:iio:dac: Add AD5764 driver

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

 



On 11/21/2011 10:04 AM, Shubhrajyoti Datta wrote:

>> +static int ad5764_chan_info_to_reg(struct iio_chan_spec const *chan, long info)
>> +{
>> +       switch (info) {
>> +       case 0:
>> +               return AD5764_REG_DATA(chan->address);
>> +       case IIO_CHAN_INFO_CALIBBIAS:
>> +               return AD5764_REG_OFFSET(chan->address);
>> +       case IIO_CHAN_INFO_CALIBSCALE:
>> +               return AD5764_REG_FINE_GAIN(chan->address);
>> +       default:
>> +               BUG();
> Should we BUG here?
> Is it that severe  because it will halt the whole system?

given that this should only trigger if something went wrong really bad I
think it is OK to BUG here. As far as I can see the compiler will even
remove it, since it is in a dead code path.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux