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] [day] [month] [year] [list]
Date:   Thu, 25 Jul 2019 12:14:06 +0300
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Chuhong Yuan <hslester96@...il.com>
Cc:     "Cao, Bingbu" <bingbu.cao@...el.com>,
        "Zhi, Yong" <yong.zhi@...el.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Akihiro Tsukada <tskd08@...il.com>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: pci: Use dev_get_drvdata where possible

On Wed, Jul 24, 2019 at 09:23:41AM +0800, Chuhong Yuan wrote:
> On Tue, Jul 23, 2019 at 10:39 PM Cao, Bingbu <bingbu.cao@...el.com> wrote:
> >
> >
> >
> > ________________________
> > BRs,
> > Bingbu Cao
> >
> >
> > -----Original Message-----
> > From: Chuhong Yuan <hslester96@...il.com>
> > Sent: Tuesday, July 23, 2019 7:50 PM
> > Cc: Zhi, Yong <yong.zhi@...el.com>; Sakari Ailus <sakari.ailus@...ux.intel.com>; Cao, Bingbu <bingbu.cao@...el.com>; Mauro Carvalho Chehab <mchehab@...nel.org>; Akihiro Tsukada <tskd08@...il.com>; linux-media@...r.kernel.org; linux-kernel@...r.kernel.org; Chuhong Yuan <hslester96@...il.com>
> > Subject: [PATCH] media: pci: Use dev_get_drvdata where possible
> >
> > Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler.
> >
> > Signed-off-by: Chuhong Yuan <hslester96@...il.com>
> > ---
> >  drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 +--
> >  drivers/media/pci/pt1/pt1.c              | 6 ++----
> >  drivers/media/pci/pt3/pt3.c              | 6 ++----
> >  3 files changed, 5 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> > index c1d133e17e4b..50a34bcd4d14 100644
> > --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> > +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> > @@ -2000,8 +2000,7 @@ static int __maybe_unused cio2_suspend(struct device *dev)
> >
> >  static int __maybe_unused cio2_resume(struct device *dev)  {
> > -       struct pci_dev *pci_dev = to_pci_dev(dev);
> > -       struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
> > +       struct cio2_device *cio2 = dev_get_drvdata(dev);
> >
> > Thanks for your patch.
> > I think using pci_get_drvdata() here mainly make a pair with the pci_set_drvdata() in probe.
> 
> Thanks for your reply.
> I will change pci_set_drvdata() to dev_set_drvdata() in the next
> version to keep their consistency.

Sorry guys; I like this one better. These pci_*() functions are just
wrappers around the dev_*() equivalents; you can use the one you like at
any given occasion. In this case the pci prefixed one is more convenient.

-- 
Kind regards,

Sakari Ailus
sakari.ailus@...ux.intel.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ