Skip to contentSkip to conversation

sata_mv: silence an uninitialized variable warning

PATCH New Dan Carpenter 1 participant 1 message Mar 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sata_mv: silence an uninitialized variable warning

Gcc version 4.6.2-12 complains that if we can't find the "nr-ports" property in of_property_read_u32_array() then "n_ports" is used uninitialized. Let's set it to zero in that case.

drivers/ata/sata_mv.c +2 -1
index ebd0d24..3d8d5c6 100644
@@ -4026,7 +4026,8 @@ static int mv_platform_probe(struct platform_device *pdev)
 	struct ata_host *host;
 	struct mv_host_priv *hpriv;
 	struct resource *res;
-	int n_ports, rc;
+	int n_ports = 0;
+	int rc;
 
 	ata_print_version_once(&pdev->dev, DRV_VERSION);