sata_mv: silence an uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 10 Mar 2012 09:00:05 +0000 (12:00 +0300)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 12 Apr 2012 19:57:22 +0000 (15:57 -0400)
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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_mv.c

index 38950ea8398a9ebb05425a62b448578acfe172a1..7336d4a7ab317c091b7b991a1355a712f58023ab 100644 (file)
@@ -4025,7 +4025,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);