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]
Date:	Mon, 5 Jan 2009 14:32:27 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Pavel Machek <pavel@...e.cz>
Cc:	Len Brown <lenb@...nel.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	pm list <linux-pm@...ts.linux-foundation.org>,
	Matthew Wilcox <matthew@....cx>,
	"H. Peter Anvin" <hpa@...or.com>,
	LKML <linux-kernel@...r.kernel.org>, Greg KH <greg@...ah.com>,
	Linux PCI <linux-pci@...r.kernel.org>
Subject: Re: [RFC][PATCH 6/10] PCI PM: Rearrange code in pci-driver.c

On Monday 05 January 2009, Pavel Machek wrote:
> Hi!
> 
> > Rename two functions and rearrange code in drivers/pci/pci-driver.c
> > so that it's easier to follow.  In particular, separate invocations
> > of the legacy callbacks from the rest of the new callbacks' code.
> > 
> > No functional changes should result from this.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
> > ---
> >  drivers/pci/pci-driver.c |  104 +++++++++++++++++++++++++++++------------------
> >  1 file changed, 65 insertions(+), 39 deletions(-)
> >
> 
> > @@ -504,17 +504,21 @@ static int pci_pm_suspend(struct device 
> >  	struct device_driver *drv = dev->driver;
> >  	int error = 0;
> >  
> > +	if (pci_has_legacy_pm_support(pci_dev)) {
> > +		error = pci_legacy_suspend(dev, PMSG_SUSPEND);
> > +		goto Exit;
> > +	}
> > +
> >  	if (drv && drv->pm) {
> >  		if (drv->pm->suspend) {
> >  			error = drv->pm->suspend(dev);
> >  			suspend_report_result(drv->pm->suspend, error);
> >  		}
> > -	} else if (pci_has_legacy_pm_support(pci_dev)) {
> > -		error = pci_legacy_suspend(dev, PMSG_SUSPEND);
> >  	} else {
> >  		pci_pm_default_suspend(pci_dev);
> >  	}
> >
> 
> Does this mean that pci_has_legacy_pm_support() => !(drv && drv->pm) ?

Yes, it does.

> Should pci_has_legacy_pm_support() check for that and WARN() in case
> both sets of callbacks are set?

Yes, I think I can add a WARN_ON() in there.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ