Re: [PATCH 2/5] iio: Introduce iio_validate_scan_mask_onehot

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

 



On 07/02/2012 02:52 PM, Peter Meerwald wrote:
> 
>> Add a helper function for validating a scan mask for devices where at most one
>> channel may be selected at a time. This is a common case among devices which
>> have scan mask restrictions so it makes sense to provide this function in the
>> core.
> 
> personally, would find iio_validate_scan_mask_atmost_one clearer than
> iio_validate_scan_mask_onehot, but it is a bit longer also

I think the code can even be changed to be more strict and just check if
bitmap_weight == 1. A mask is only validating after enabling a channel and
not after disabling it, so there will always be at least one bit set when
the validate function is called.

- 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