linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IDE: fix PCI must_checks
@ 2007-04-05  4:37 Randy Dunlap
  2007-04-05 11:13 ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2007-04-05  4:37 UTC (permalink / raw)
  To: ide; +Cc: bzolnier, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Check PCI interface function results for errors in drivers/ide/pci.

drivers/ide/pci/cs5530.c:244: warning: ignoring return value of 'pci_set_mwi', declared with attribute warn_unused_result

drivers/ide/pci/sc1200.c:397: warning: ignoring return value of 'pci_enable_device', declared with attribute warn_unused_result

drivers/ide/setup-pci.c:861: warning: ignoring return value of '__pci_register_driver', declared with attribute warn_unused_result

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/ide/pci/cs5530.c |    4 +++-
 drivers/ide/pci/sc1200.c |    8 +++++++-
 drivers/ide/setup-pci.c  |    6 +++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

--- linux-2.6.21-rc5-mm4.orig/drivers/ide/pci/cs5530.c
+++ linux-2.6.21-rc5-mm4/drivers/ide/pci/cs5530.c
@@ -236,7 +236,9 @@ static unsigned int __devinit init_chips
 	 */
 
 	pci_set_master(cs5530_0);
-	pci_set_mwi(cs5530_0);
+	if (pci_set_mwi(cs5530_0))
+		printk(KERN_WARNING "%s: error enabling PCI MWI transactions\n",
+			name);
 
 	/*
 	 * Set PCI CacheLineSize to 16-bytes:
--- linux-2.6.21-rc5-mm4.orig/drivers/ide/pci/sc1200.c
+++ linux-2.6.21-rc5-mm4/drivers/ide/pci/sc1200.c
@@ -382,10 +382,16 @@ static int sc1200_suspend (struct pci_de
 static int sc1200_resume (struct pci_dev *dev)
 {
 	ide_hwif_t	*hwif = NULL;
+	int		err;
 
 	pci_set_power_state(dev, PCI_D0);	// bring chip back from sleep state
 	dev->current_state = PM_EVENT_ON;
-	pci_enable_device(dev);
+	err = pci_enable_device(dev);
+	if (err) {
+		printk(KERN_ERR "SC1200: cannot enable device for resume\n");
+		return err;
+	}
+
 	//
 	// loop over all interfaces that are part of this pci device:
 	//
--- linux-2.6.21-rc5-mm4.orig/drivers/ide/setup-pci.c
+++ linux-2.6.21-rc5-mm4/drivers/ide/setup-pci.c
@@ -874,9 +874,13 @@ void __init ide_scan_pcibus (int scan_di
 
 	list_for_each_safe(l, n, &ide_pci_drivers)
 	{
+		int err;
 		list_del(l);
 		d = list_entry(l, struct pci_driver, node);
-		__pci_register_driver(d, d->driver.owner, d->driver.mod_name);
+		err = __pci_register_driver(d, d->driver.owner, d->driver.mod_name);
+		if (err)
+			printk(KERN_ERR "%s: failed to register PCI driver\n",
+				d->driver.mod_name);
 	}
 }
 #endif

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-04-16 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05  4:37 [PATCH] IDE: fix PCI must_checks Randy Dunlap
2007-04-05 11:13 ` Alan Cox
2007-04-05 20:03   ` Andrew Morton
2007-04-05 20:16     ` Alan Cox
2007-04-05 21:20       ` Andrew Morton
2007-04-06  5:05         ` Randy Dunlap
2007-04-06 17:41           ` Alan Cox
2007-04-16 17:19         ` [RFC/PATCH -mm] add pci_try_set_mwi Randy Dunlap

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).