Re: [Sound-open-firmware] [alsa-devel] [PATCH 01/21] ASoC: SOF: Intel: Add BYT, CHT and BSW DSP HW support.
Thanks for the review.
+++ b/sound/soc/sof/intel/shim.h @@ -0,0 +1,159 @@ ... +extern struct snd_sof_dsp_ops sof_byt_ops; +extern struct snd_sof_dsp_ops sof_cht_ops;
These two symbols are found in this patch.
+extern struct snd_sof_dsp_ops sof_hsw_ops;
This symbol is added in second patch and this first patch has no reference to it.
+extern struct snd_sof_dsp_ops sof_bdw_ops;
This symbol is added in third patch and this first patch has no reference to it.
+#endif
I think it better to add these extern declarations when adding corresponding symbols (Of course no issues as is).
Yes, that's no big deal. It won't break as is though since the build is added in the last patch.
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.
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));
participants (1)
-
Pierre-Louis Bossart