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: <CAHp75Vf-_me0HxTZ5cm7Tc_Y5oVqO7qOQvKycjjDv_7C91+Q+g@mail.gmail.com>
Date:   Tue, 2 Jul 2019 15:34:43 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Fuqian Huang <huangfq.daxian@...il.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Vladimir Zapolskiy <vz@...ia.com>,
        Sylvain Lemieux <slemieux.tyco@...il.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Olof Johansson <olof@...om.net>,
        H Hartley Sweeten <hsweeten@...ionengravers.com>,
        Arnd Bergmann <arnd@...db.de>, Enrico Weigelt <info@...ux.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Anson Huang <anson.huang@....com>,
        Richard Fontana <rfontana@...hat.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Allison Randal <allison@...utok.net>,
        Christian Hoff <christian_hoff@....net>,
        Tony Lindgren <tony@...mide.com>,
        Alexios Zavras <alexios.zavras@...el.com>,
        Gabriel Fernandez <gabriel.fernandez@...com>,
        Luca Weiss <luca@...tu.xyz>, Rob Herring <robh@...nel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Brian Masney <masneyb@...tation.org>,
        Lee Jones <lee.jones@...aro.org>,
        Pascal PAILLET-LME <p.paillet@...com>,
        linux-input <linux-input@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        linux-tegra@...r.kernel.org
Subject: Re: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata()

On Tue, Jul 2, 2019 at 2:47 PM Fuqian Huang <huangfq.daxian@...il.com> wrote:
>
> Andy Shevchenko <andy.shevchenko@...il.com> 於 2019年7月2日週二 下午5:51寫道:
> >
> > On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang <huangfq.daxian@...il.com> wrote:
> > >
> > > I am not an expert on this. I just write a coccinelle script to search
> > > this kind of misuse and fix it in a naive way.
> > > Could you tell me about how to use the proper bus accessors? Then I
> > > will fix it up and resend a v2 patch set.
> >
> > First, don't top post.
> > And answering to this, simple drop the patch.
> > Proper bus accessors is exactly what it's used in the current code.
>
> But why not use dev_get_drvdata directly.
> It simplifies getting the 'driver_data' from 'struct device' directly.
> And the platform_device here is not required.
> Replace it can remove the unnecessary step back and forth. (dev -> pdev -> dev).

Like just now Lothar gives a good idea for you to sell is to check
compiler output.

But the question itself is addressed to subsystem maintainer.

> Just like the commit

> 1948d498dcf6("thermal: intel: int340x: processor_thermal_device:
> simplify to get driver data")

Side note: this example is not good, since the macro is bus agnostic.

> and many other similar commits in the Linux git log.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ