Re: [PATCH v2 2/2] ASoC: wm8985: add device-tree support

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

 



On 20 May 2016 at 18:21, Charles Keepax
<ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, May 17, 2016 at 02:49:49PM +0200, Petr Kulhavy wrote:
>> +static enum wm8985_type wm8985_data = WM8985;
>> +static enum wm8985_type wm8758_data = WM8758;
>> +
>> +static const struct of_device_id wm8985_of_match[] = {
>> +     { .compatible = "wlf,wm8985", .data = &wm8985_data},
>> +     { .compatible = "wlf,wm8758", .data = &wm8758_data},
>
> You can probably just use (void *)WM8985 instead here.

I know this pretty safe with integers but can you do this with enums?
Doesn't it lead to undefined behaviour?

Regards
Petr
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux