linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure
@ 2009-09-12 18:37 Jaswinder Singh Rajput
  2009-09-14  9:24 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Jaswinder Singh Rajput @ 2009-09-12 18:37 UTC (permalink / raw)
  To: Jeff Garzik, Tejun Heo, linux-ide

[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



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

* Re: [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2009-09-14  9:24 UTC (permalink / raw)
  To: Jaswinder Singh Rajput; +Cc: Jeff Garzik, linux-ide

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

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

end of thread, other threads:[~2009-09-14  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).