* [patch] sata_mv: silence an uninitialized variable warning
@ 2012-03-10 9:00 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-03-10 9:00 UTC (permalink / raw)
To: Jeff Garzik, Michael Walle
Cc: Grant Likely, Rob Herring, linux-ide, linux-kernel,
devicetree-discuss, kernel-janitors
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>
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index ebd0d24..3d8d5c6 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-10 9:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10 9:00 [patch] sata_mv: silence an uninitialized variable warning Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox