Re: [PATCH 01/18] iio: Extend the event config interface

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

 



On 09/29/2013 10:17 PM, Jonathan Cameron wrote:
> On 09/29/13 19:56, Lars-Peter Clausen wrote:
>> I think a transparent union should work nicely and doesn't cause any code
>> churn. Maybe even with a direct pointer to the event_spec.
>>
>> Something like:
>>
>> struct iio_dev_attr {
>> 	...
>> 	union {
>> 		u64 address;
>> 		struct {
>> 			struct iio_event_spec *spec;
>> 			enum iio_event_info info;
>> 		} event;
>> 	};
>> 	...
>> };
> Looks good to me.

There is a bug[1] in gcc < 4.6 that breaks this for static struct
initializers. E.g.

static struct iio_dev_attr attr = {
	...
	.address = 123,
	...
};

wont work. So I guess this means we can't use it for now.

- Lars

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
--
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