[alsa-devel] [PATCH 14/21] ASoC: soc-core: have legacy_dai_naming at snd_soc_register_dai()
Pierre-Louis Bossart
pierre-louis.bossart at linux.intel.com
Fri Oct 11 15:43:56 CEST 2019
On 10/10/19 8:07 PM, Kuninori Morimoto wrote:
>
> Hi Pierre-Louis
>
> Thank you for your feedback
>
>>> snd_soc_register_dai() is now used from topology.
>>> But, to reduce duplicated code, it will be used from soc-core, too.
>>> To prepare for it, this patch adds missing parameter legacy_dai_naming
>>> to snd_soc_register_dai().
>>
>> It doesn't look like this series reduces the confusion between
>> snd_soc_register_dai() and snd_soc_register_dais() ?
>>
>> maybe for the latter case since it's a static function we don't want
>> the entire prefix then?
>
> Maybe my explain is not so good...
> The point is that, in general people think like below from naming.
> Other functions are this style.
>
> => int snd_soc_register_dai()
> {
> ...
> }
>
> int snd_soc_register_dais()
> {
> for(..) {
> => snd_soc_register_dai()
> }
> }
>
> But in reality is like this
>
> int snd_soc_register_dai()
> {
> /* almost same but different code */
> }
>
> snd_soc_register_dais()
> {
> /* almost same but different code */
> }
>
> To avoid duplicate code and confusion,
> this patchset try to implement "general" style.
> But needs some preparation.
>
> I will fix log and English.
I get your point, what I was trying to suggest is that we only use the
full snd_soc prefix for non-static functions that can be called by other
files, for static functions we can use just the soc prefix. It's a
convention that helps the reader understand what is local and what is
common/shared.
More information about the Alsa-devel
mailing list