linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Dexuan Cui <decui@microsoft.com>,
	driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	jackm@mellanox.com, Haiyang Zhang <haiyangz@microsoft.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	linux-hyperv@vger.kernel.org,
	Michael Kelley <mikelley@microsoft.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>,
	marcelo.cerri@canonical.com, linux-pci@vger.kernel.org,
	apw@canonical.com, vkuznets@redhat.com,
	Bjorn Helgaas <bhelgaas@google.com>,
	jasowang@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/7] PCI/PM: Make power management op coding style consistent
Date: Wed, 16 Oct 2019 16:50:02 +0300	[thread overview]
Message-ID: <20191016135002.GA24678@kadam> (raw)
In-Reply-To: <20191014230016.240912-6-helgaas@kernel.org>

On Mon, Oct 14, 2019 at 06:00:14PM -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.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


  parent reply	other threads:[~2019-10-16 13:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 23:00 [PATCH v3 0/7] PCI: PM: Move to D0 before calling pci_legacy_resume_early() Bjorn Helgaas
2019-10-14 23:00 ` [PATCH 1/7] PCI/PM: Always return devices to D0 when thawing Bjorn Helgaas
2019-10-15 17:15   ` Rafael J. Wysocki
2019-10-14 23:00 ` [PATCH 2/7] PCI/PM: Correct pci_pm_thaw_noirq() documentation Bjorn Helgaas
2019-10-15 17:17   ` Rafael J. Wysocki
2019-10-14 23:00 ` [PATCH 3/7] PCI/PM: Clear PCIe PME Status even for legacy power management Bjorn Helgaas
2019-10-15 17:20   ` Rafael J. Wysocki
2019-10-14 23:00 ` [PATCH 4/7] PCI/PM: Run resume fixups before disabling wakeup events Bjorn Helgaas
2019-10-15 17:21   ` Rafael J. Wysocki
2019-10-14 23:00 ` [PATCH 5/7] PCI/PM: Make power management op coding style consistent Bjorn Helgaas
2019-10-15 17:22   ` Rafael J. Wysocki
2019-10-16 13:50   ` Dan Carpenter [this message]
2019-10-14 23:00 ` [PATCH 6/7] PCI/PM: Wrap long lines in documentation Bjorn Helgaas
2019-10-15 17:23   ` Rafael J. Wysocki
2019-10-14 23:00 ` [PATCH 7/7] PCI/MSI: Move power state check out of pci_msi_supported() Bjorn Helgaas
2019-10-15 17:24   ` Rafael J. Wysocki
2019-10-15 18:24 ` [PATCH v3 0/7] PCI: PM: Move to D0 before calling pci_legacy_resume_early() Dexuan Cui
2019-10-15 18:42 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191016135002.GA24678@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Alexander.Levin@microsoft.com \
    --cc=apw@canonical.com \
    --cc=bhelgaas@google.com \
    --cc=decui@microsoft.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=helgaas@kernel.org \
    --cc=jackm@mellanox.com \
    --cc=jasowang@redhat.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marcelo.cerri@canonical.com \
    --cc=mikelley@microsoft.com \
    --cc=olaf@aepfle.de \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).