Skip to content

Commit

Permalink
sata_mv: silence an uninitialized variable warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Jeff Garzik committed Apr 12, 2012
1 parent 96d5d96 commit 99b80e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 99b80e9

Please sign in to comment.