[PATCH] libata-core: disable uninitialized var warning

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

 



Make GCC happy by disabling the warning

drivers/ata/libata-core.c: In function 'ata_hpa_resize':
drivers/ata/libata-core.c:1394:3: warning: 'native_sectors' may be used uninitialized in this function [-Wmaybe-uninitialized]

Looking on the code, 'native_sectors' is always initialized by calling
ata_read_native_max_address(dev, &native_sectors).

Signed-off-by: Dirk Behme <dirk.behme@xxxxxxxxx>
CC: Jeff Garzik <jgarzik@xxxxxxxxx>
---
 drivers/ata/libata-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9e8b99a..21623cf 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1324,7 +1324,7 @@ static int ata_hpa_resize(struct ata_device *dev)
 	int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
 	bool unlock_hpa = ata_ignore_hpa || dev->flags & ATA_DFLAG_UNLOCK_HPA;
 	u64 sectors = ata_id_n_sectors(dev->id);
-	u64 native_sectors;
+	u64 native_sectors = 0 /* GCC */;
 	int rc;
 
 	/* do we need to do it? */
-- 
1.7.10.4

--
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