public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Horms <horms@verge.net.au>
To: mpt_linux_developer@lsi.com, linux-scsi@vger.kernel.org
Cc: Eric Moore <Eric.Moore@lsi.com>
Subject: [PATCH 2/2] fusion - honour return value of pci_enable_device() in mpt_resume()
Date: Fri, 16 Mar 2007 16:05:51 +0900	[thread overview]
Message-ID: <20070316070550.GC1081@verge.net.au> (raw)
In-Reply-To: <20070316070521.GB1081@verge.net.au>

Honour the return value of pci_enable_device(), which
seems to be a desirable thing to do:

  2.6.20-rc4
  gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

    CC [M]  drivers/message/fusion/mptbase.o
    drivers/message/fusion/mptbase.c: In function `mpt_resume':
    drivers/message/fusion/mptbase.c:1541: warning: ignoring return value
    of `pci_enable_device', declared with attribute warn_unused_result

It also in turn has mptscsih_resume() honour the return value of
mpt_resume()

I'm not sure about the handling of the other potential error cases
in mpt_resume(), of which there appear to be many. But this does
seem to be a good start.

Signed-off-by: Simon Horman <horms@verge.net.au>

Index: linux-2.6/drivers/message/fusion/mptbase.c
===================================================================
--- linux-2.6.orig/drivers/message/fusion/mptbase.c	2007-03-16 16:00:01.000000000 +0900
+++ linux-2.6/drivers/message/fusion/mptbase.c	2007-03-16 16:02:23.000000000 +0900
@@ -1531,6 +1531,7 @@
 	MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
 	u32 device_state = pdev->current_state;
 	int recovery_state;
+	int err;
 
 	printk(MYIOC_s_INFO_FMT
 	"pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
@@ -1538,7 +1539,9 @@
 
 	pci_set_power_state(pdev, 0);
 	pci_restore_state(pdev);
-	pci_enable_device(pdev);
+	err = pci_enable_device(pdev);
+	if (err < 0)
+		return err;
 
 	/* enable interrupts */
 	CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
Index: linux-2.6/drivers/message/fusion/mptscsih.c
===================================================================
--- linux-2.6.orig/drivers/message/fusion/mptscsih.c	2007-03-16 16:00:01.000000000 +0900
+++ linux-2.6/drivers/message/fusion/mptscsih.c	2007-03-16 16:02:23.000000000 +0900
@@ -1188,8 +1188,7 @@
 int
 mptscsih_resume(struct pci_dev *pdev)
 {
-	mpt_resume(pdev);
-	return 0;
+	return mpt_resume(pdev);
 }
 
 #endif

  reply	other threads:[~2007-03-16  7:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16  7:05 [PATCH 1/2] fusion - removed unnecessary code in mptscsih_resume() Horms
2007-03-16  7:05 ` Horms [this message]
2007-03-16 14:27   ` [PATCH 2/2] fusion - honour return value of pci_enable_device() in mpt_resume() James Bottomley
2007-03-16 15:06     ` Randy Dunlap
2007-03-16 16:14       ` James Bottomley
2007-03-16 15:20         ` Randy Dunlap
2007-03-16 17:18           ` Douglas Gilbert
2007-03-19  6:06     ` Horms
2007-03-17  0:00   ` Moore, Eric

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=20070316070550.GC1081@verge.net.au \
    --to=horms@verge.net.au \
    --cc=Eric.Moore@lsi.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpt_linux_developer@lsi.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