lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vf5xtqpJV6LZZDLwz0LRQVShyPrfsj9kSDrgh_0k_qMcA@mail.gmail.com>
Date:   Wed, 6 Oct 2021 19:44:13 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Brent Lu <brent.lu@...el.com>
Cc:     ALSA Development Mailing List <alsa-devel@...a-project.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Cezary Rojewski <cezary.rojewski@...el.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Jie Yang <yang.jie@...ux.intel.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Guennadi Liakhovetski <guennadi.liakhovetski@...ux.intel.com>,
        Yong Zhi <yong.zhi@...el.com>,
        Vamshi Krishna Gopal <vamshi.krishna.gopal@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Rander Wang <rander.wang@...el.com>,
        Bard Liao <bard.liao@...el.com>,
        Malik_Hsu <malik_hsu@...tron.corp-partner.google.com>,
        Libin Yang <libin.yang@...el.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Charles Keepax <ckeepax@...nsource.cirrus.com>,
        Paul Olaru <paul.olaru@....nxp.com>,
        Curtis Malainey <cujomalainey@...omium.org>,
        Mac Chiang <mac.chiang@...el.com>,
        Gongjun Song <gongjun.song@...el.com>
Subject: Re: [PATCH 1/3] ASoC: soc-acpi: add alternative id field for machine
 driver matching

On Wed, Oct 6, 2021 at 7:21 PM Brent Lu <brent.lu@...el.com> wrote:
>
> Current design to support second headphone driver in the same machine
> driver is to duplicate the entries in snd_soc_acpi_mach array and
> board configs in machine driver. We can avoid this by adding an id_alt
> field in snd_soc_acpi_mach structure to specify alternative ACPI HIDs
> for machine driver enumeration and leave the codec type detection to
> machine driver if necessary.

...

> +static bool snd_soc_acpi_id_present(struct snd_soc_acpi_mach *machine)
> +{
> +       struct snd_soc_acpi_codecs *id_alt = machine->id_alt;
> +       int i;
> +
> +       if (acpi_dev_present(machine->id, NULL, -1))
> +               return true;
> +
> +       if (id_alt == NULL)
> +               return false;
> +
> +       for (i = 0; i < id_alt->num_codecs; i++) {
> +               if (acpi_dev_present(id_alt->codecs[i], NULL, -1))
> +                       return true;
> +       }
> +
> +       return false;
> +}

Wondering if you may modify data structure in a way that makes it
possible to use for_each_acpi_dev_match().

...

> +               if (snd_soc_acpi_id_present(mach) != false) {

' != fase' is redundant.



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ