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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1807041459110.11004@fox.voss.local>
Date:   Wed, 4 Jul 2018 15:00:02 +0200 (CEST)
From:   Nikolaus Voss <nikolaus.voss@...wensteinmedical.de>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Lorenzo Bianconi <lorenzo.bianconi83@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Xiongfeng Wang <xiongfeng.wang@...aro.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ACPI: bus.c: Let acpi_device_get_match_data() return DT
 compatibility data

On Wed, 4 Jul 2018, Andy Shevchenko wrote:
> On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss
> <nikolaus.voss@...wensteinmedical.de> wrote:
>
> Thanks for the patch, now I completely got it and agree on approach.
> Few comments below.
>
>> When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to
>> of_device_id table "compatible" strings in DSD, a pointer to the
>
> _DSD
>
>> corresponding DT table entry should be returned instead of a null
>> pointer. An acpi_device_id match still takes precedence.
>
>>  const void *acpi_device_get_match_data(const struct device *dev)
>>  {
>> -       const struct acpi_device_id *match;
>> +       const struct acpi_device_id *acpi_id = NULL;
>> +       const struct of_device_id *of_id = NULL;
>> +       const struct device_driver *drv = dev->driver;
>>
>> -       match = acpi_match_device(dev->driver->acpi_match_table, dev);
>> -       if (!match)
>
>> +       __acpi_match_device(acpi_companion_match(dev), drv->acpi_match_table,
>> +                           drv->of_match_table, &acpi_id, &of_id);
>
> Perhaps,
>
> bool match;
>
> match = __acpi_match_device(..);
> if (!match)
> return NULL;
>
> ...
>> +       if (acpi_id)
>> +               return (const void*)acpi_id->driver_data;
>> +       else if (of_id)
>> +               return (const void*)of_id->data;
>
> Actually (dbesides redundant 'else') there is no difference in which
> order you test these.
> Thus, perhaps
>
> if (of_id)
> return ...of_id...;
>
> return ...acpi_id...;
>
>> -       return (const void *)match->driver_data;
>>  }

Thanks for reviewing and feedback, posted v2...

Niko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ