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

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Dec 12 20:24:07 CET 2018


>>
>> 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));



More information about the Alsa-devel mailing list