Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Jeff Garzik <jeff@garzik.org>, Tejun Heo <tj@kernel.org>,
	linux-ide@vger.kernel.org
Subject: [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure
Date: Sun, 13 Sep 2009 00:07:06 +0530	[thread overview]
Message-ID: <1252780626.3687.20.camel@ht.satnam> (raw)

[This is untested]

By checking sil_scr_read, we can get rid of this compilation warning:

  CC [M]  drivers/ata/sata_sil.o
drivers/ata/sata_sil.c: In function ‘sil_host_intr’:
drivers/ata/sata_sil.c:442: warning: ‘serror’ may be used uninitialized in this function

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 drivers/ata/sata_sil.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 3cb69d5..a908031 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -445,7 +445,8 @@ static void sil_host_intr(struct ata_port *ap, u32 bmdma2)
 		 * controllers continue to assert IRQ as long as
 		 * SError bits are pending.  Clear SError immediately.
 		 */
-		sil_scr_read(&ap->link, SCR_ERROR, &serror);
+		if (sil_scr_read(&ap->link, SCR_ERROR, &serror))
+			return;
 		sil_scr_write(&ap->link, SCR_ERROR, serror);
 
 		/* Sometimes spurious interrupts occur, double check
-- 
1.6.4.2



             reply	other threads:[~2009-09-12 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-12 18:37 Jaswinder Singh Rajput [this message]
2009-09-14  9:24 ` [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure Tejun Heo

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=1252780626.3687.20.camel@ht.satnam \
    --to=jaswinder@kernel.org \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=tj@kernel.org \
    /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