Re: [Sound-open-firmware] [PATCH 01/21] ASoC: SOF: Intel: Add BYT, CHT and BSW DSP HW support.

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

 





Furthermore, if you have no plan to change contents of these symbols in
kernel run time, it's better to have 'const' qualifier to locate the
symbol to readonly section. However, user of these symbols is machine
driver and you have a plan to implement it later. They can get 'const'
when you work for arrangement of existent/new codes.
Good point, I don't think the ops are changed, ever. I'll double-check and change if indeed this is the case, thanks for the suggestion.

In this meaning, it might be good to add a new member to 'struct
snd_soc_acpi_mach' for new drivers to refer to the const ops, then
'pdata' member is used from the existent drivers.
Sorry, I don't get your point. the ops structure is included in the sof_ops_table, not the snd_soc_acpi_mach.

I get your point now, after moving all the ops to a const qualifier, I still have the 3 errors below. We should indeed have an ops field in the generic acpi structure, excellent suggestion. This change also helped identify that we have redundant/hidden declarations in hda.c, so we can improve the code further.

I'll do that at a later point though since it will impact 2 other drivers, for now I'll mark these as TODO with an explicit cast.

Thanks again for your feedback

-Pierre

sound/soc/sof/sof-acpi-dev.c: In function ‘sof_acpi_probe’:
sound/soc/sof/sof-acpi-dev.c:200:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  mach->pdata = ops;
              ^
  CC [M]  sound/soc/sof/sof-pci-dev.o
sound/soc/sof/sof-pci-dev.c: In function ‘sof_pci_probe’:
sound/soc/sof/sof-pci-dev.c:247:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  mach->pdata = ops;
              ^
  CC [M]  sound/soc/sof/sof-spi-dev.o
sound/soc/sof/sof-spi-dev.c: In function ‘sof_spi_probe’:
sound/soc/sof/sof-spi-dev.c:119:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  mach->pdata = sof_get_ops(desc, spi_mach_ops, ARRAY_SIZE(spi_mach_ops));

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




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

  Powered by Linux