All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>, linux-ide@vger.kernel.org
Subject: Re: [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure
Date: Mon, 14 Sep 2009 18:24:44 +0900	[thread overview]
Message-ID: <4AAE0BDC.4040403@kernel.org> (raw)
In-Reply-To: <1252780626.3687.20.camel@ht.satnam>

Jaswinder Singh Rajput wrote:
> [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);

Eh.... the driver knows the call wouldn't fail.  I think
uninitialized_var() would be more appropriate here.

Thanks.

-- 
tejun

      reply	other threads:[~2009-09-14  9:24 UTC|newest]

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

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=4AAE0BDC.4040403@kernel.org \
    --to=tj@kernel.org \
    --cc=jaswinder@kernel.org \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.