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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Jul 2018 00:07:23 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Nikolaus Voss <nikolaus.voss@...wensteinmedical.de>
Cc:     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>, nv@...n.de,
        linux-iio@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data

On Tue, Jul 3, 2018 at 8:41 AM, Nikolaus Voss
<nikolaus.voss@...wensteinmedical.de> wrote:
> Use device_get_match_data API to simplify access to driver data.

..._data()

But. You actually don't use it below.

> Let acpi_device_id table entries point to the same driver data as
> of_device_id table entries and uniquify access to driver data by using
> device_get_match_data API.

>  #include <linux/acpi.h>
>  #include <linux/i2c.h>
>  #include <linux/iio/iio.h>

> +#include <linux/of_device.h>

(linux/property.h)

> +       match = of_device_get_match_data(&client->dev);
> +       if (!match)
> +               match = acpi_device_get_match_data(&client->dev);

What I meant is to simply call

match = device_get_match_data(...);

> +       if (match)
> +               strlcpy(client->name, match, sizeof(client->name));

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ