RE: [PATCH 17/51 v2] staging: comedi: ni_labpc: introduce labpc_range_is_unipolar()

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

 



On Monday, March 25, 2013 3:20 AM, Ian Abbott wrote:
> On 2013-03-22 16:42, H Hartley Sweeten wrote:
>> +static bool labpc_range_is_unipolar(struct comedi_subdevice *s,
>> +				    unsigned int range)
>> +{
>> +	const struct comedi_lrange *lrange = s->range_table;
>> +	const struct comedi_krange *krange = &lrange->range[range];
>> +
>> +	if (krange->min < 0)
>> +		return false;
>> +	else
>> +		return true;
>> +}
>
> That last bit could be simplified to:
>
>	return krange->min >= 0;
>
> but it doesn't really matter.

I like that better.

I need to check the other comedi drivers to see if this should maybe be
a generic "comedi_range_is_unipolar" helper in comedidev.h.

Regards,
Hartley


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux