Skip to contentSkip to conversation

libata: fix compile warning caused by ignoring __must_check results

PATCH In review Tejun Heo 2 participants 3 messages Jan 20, 2007 – Jan 22, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: fix compile warning caused by ignoring __must_check results

Fix compile warnings in pata_cs5530, sata_inic162x and sata_nv which are caused by throwing away return values marked with __must_check.

---
 drivers/ata/pata_cs5530.c   |    6 +++++-
 drivers/ata/sata_inic162x.c |    4 +++-
 drivers/ata/sata_nv.c       |    5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)
drivers/ata/pata_cs5530.c +5 -1
Index: work/drivers/ata/pata_cs5530.c
===================================================================
@@ -251,6 +251,7 @@ static int cs5530_is_palmax(void)
 static int cs5530_init_chip(void)
 {
 	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL, *dev = NULL;
+	int rc;
 
 	while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) {
 		switch (dev->device) {
@@ -272,7 +273,10 @@ static int cs5530_init_chip(void)
 	}
 
 	pci_set_master(cs5530_0);
-	pci_set_mwi(cs5530_0);
+	rc = pci_set_mwi(cs5530_0);
+	if (rc)
+		dev_printk(KERN_WARNING, &cs5530_0->dev,
+			   "WARNING: failed to set MWI\n");
 
 	/*
 	 * Set PCI CacheLineSize to 16-bytes:
drivers/ata/sata_inic162x.c +3 -1
Index: work/drivers/ata/sata_inic162x.c
===================================================================
@@ -649,7 +649,9 @@ static int inic_pci_device_resume(struct
 	void __iomem *mmio_base = host->mmio_base;
 	int rc;
 
-	ata_pci_device_do_resume(pdev);
+	rc = ata_pci_device_do_resume(pdev);
+	if (rc)
+		return rc;
 
 	if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
 		printk("XXX\n");
drivers/ata/sata_nv.c +4 -1
Index: work/drivers/ata/sata_nv.c
===================================================================
@@ -1554,8 +1554,11 @@ static int nv_pci_device_resume(struct p
 {
 	struct ata_host *host = dev_get_drvdata(&pdev->dev);
 	struct nv_host_priv *hpriv = host->private_data;
+	int rc;
 
-	ata_pci_device_do_resume(pdev);
+	rc = ata_pci_device_do_resume(pdev);
+	if (rc)
+		return rc;
 
 	if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
 		if(hpriv->type >= CK804) {
#1 lore raw
Quoted 4 lines · On Sat, 20 Jan 2007 14:23:29 +0900 Tejun Heo <[email protected]> wrote:

Fix compile warnings in pata_cs5530, sata_inic162x and sata_nv which are caused by throwing away return values marked with __must_check.

NAK NAK NAK NAK NAK NAK

As was previously discussed the bug is the bogus __must_check on pci_set_mwi. That __must_check should be removed and that was also the decision before but nothing happened. Please therefore get the pci header fixed.

drivers/ata/pata_cs5530.c static int cs5530_init_chip(void) · line 279

Quoted 6 lines
drivers/ata/pata_cs5530.c +4 -1
 	pci_set_master(cs5530_0);
-	pci_set_mwi(cs5530_0);
+	rc = pci_set_mwi(cs5530_0);
+	if (rc)
+		dev_printk(KERN_WARNING, &cs5530_0->dev,
+			   "WARNING: failed to set MWI\n");

Please drop this patch. Users don't need to scared by this bogus message.

Alan

author
#2 lore raw
Quoted 6 lines · Alan
Quoted 3 lines · On Sat, 20 Jan 2007 14:23:29 +0900 Tejun Heo <[email protected]> wrote:

Fix compile warnings in pata_cs5530, sata_inic162x and sata_nv which are caused by throwing away return values marked with __must_check.

Quoted 8 lines
Quoted 1 line

NAK NAK NAK NAK NAK NAK

As was previously discussed the bug is the bogus __must_check on pci_set_mwi. That __must_check should be removed and that was also the decision before but nothing happened. Please therefore get the pci header fixed.

That works for me too. I'll drop pci_set_mwi() part.

Thanks.

Signature · 1 line
tejun