[pcnet32] Fix uninitialised variable
authorGeoff Lywood <glywood@vmware.com>
Tue, 29 Jun 2010 06:51:51 +0000 (07:51 +0100)
committerStefan Hajnoczi <stefanha@gmail.com>
Tue, 29 Jun 2010 06:54:38 +0000 (07:54 +0100)
Using gcc 4.1.2, I get the following error when running 'make bin/pcnet32.rom':

  [BUILD] bin/pcnet32.o
cc1: warnings being treated as errors
drivers/net/pcnet32.c: In function 'pcnet32_probe':
drivers/net/pcnet32.c:516: warning: 'phycount' may be used uninitialized in this function
make: *** [bin/pcnet32.o] Error 1

This patch fixes the problem.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
src/drivers/net/pcnet32.c

index 6bb2c1a..f845aa9 100644 (file)
@@ -513,7 +513,7 @@ static void
 pcnet32_setup_probe_phy ( struct pcnet32_private *priv )
 {
        unsigned long ioaddr = priv->pci_dev->ioaddr;
-       char phycount;
+       char phycount = 0;
        int phy_id;
        int i;