[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191016135002.GA24678@kadam>
Date: Wed, 16 Oct 2019 16:50:02 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Dexuan Cui <decui@...rosoft.com>,
driverdev-devel@...uxdriverproject.org, olaf@...fle.de,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Stephen Hemminger <sthemmin@...rosoft.com>, jackm@...lanox.com,
Haiyang Zhang <haiyangz@...rosoft.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
linux-hyperv@...r.kernel.org,
Michael Kelley <mikelley@...rosoft.com>,
Sasha Levin <Alexander.Levin@...rosoft.com>,
marcelo.cerri@...onical.com, linux-pci@...r.kernel.org,
apw@...onical.com, vkuznets@...hat.com,
Bjorn Helgaas <bhelgaas@...gle.com>, jasowang@...hat.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/7] PCI/PM: Make power management op coding style
consistent
On Mon, Oct 14, 2019 at 06:00:14PM -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@...gle.com>
>
> Some of the power management ops use this style:
>
> struct device_driver *drv = dev->driver;
> if (drv && drv->pm && drv->pm->prepare(dev))
> drv->pm->prepare(dev);
>
> while others use this:
>
> const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
I like this patch a lot, especially the direct returns. But it
occurs to me that in the future this conditional would look better as
const struct dev_pm_ops *pm = driver_to_pm(dev->driver);
or something.
regards,
dan carpenter
Powered by blists - more mailing lists