lkml.org 
[lkml]   [2021]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/3] ASoC: soc-acpi: add comp_ids field for machine driver matching
From
Date
On 2021-10-07 7:27 PM, Pierre-Louis Bossart wrote:
>
>>>   struct snd_soc_acpi_mach *
>>>   snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
>>>   {
>>>       struct snd_soc_acpi_mach *mach;
>>>       struct snd_soc_acpi_mach *mach_alt;
>>>   -    for (mach = machines; mach->id[0]; mach++) {
>>> -        if (acpi_dev_present(mach->id, NULL, -1)) {
>>> +    for (mach = machines; mach->id[0] || mach->comp_ids; mach++) {
>>
>> Such loops are hard to maintain i.e. 'comp_ids' acts here like a flex
>> array that follows 'id'. Removal of 'id' field and streamlining code to
>> only use 'comp_ids' should make this loop more intuitive.
>
> Changing all the tables adds more noise IMHO. There are 15 files and
> about 100 ids.
>
> This patch provides an opportunity to reduce duplication, that's good,
> but let's leave all the existing unique table entries alone, shall we?
>

Well, we could have mentioned files updated in the follow up patches
i.e. treat this patch as a 'preparation step'. In the long run, having
two places for id initialization will cost us more than updating all
those files.

Have no problem with leaving current patch as is if the end goal is
removal of 'id' field. In some future series I guess..

Czarek

\
 
 \ /
  Last update: 2021-10-07 20:46    [W:0.060 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site