Re: [RFC][PATCH] ata: sata_sil.c check sil_scr_read for failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux