]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: Fix real bugs uncovered by -Wno-uninitialized removal
authorAnton Blanchard <anton@samba.org>
Tue, 14 Sep 2004 00:43:43 +0000 (17:43 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:43:43 +0000 (17:43 -0700)
The removal of -Wno-uninitialized on ppc64 revealed a number of real
bugs.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/iSeries_pci_reset.c
drivers/char/hvcs.c
drivers/net/ibmveth.c
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/rpaphp_pci.c

index e1e48c35ea96ab5d97932066fbb09f988993ed9d..8848ece793f83571a5a71d4e7773a289482f37be 100644 (file)
@@ -65,7 +65,8 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime,
                AssertDelay = (5 * HZ) / 10;
        else
                AssertDelay = (AssertTime * HZ) / 10;
-       if (WaitDelay == 0)
+
+       if (DelayTime == 0)
                WaitDelay = (30 * HZ) / 10;
        else
                WaitDelay = (DelayTime * HZ) / 10;
index 60d10a54787d9d6e82ac8f218f81553315d20693..5f4211b0f33226998416d8e5a6294c46bcddbf38 100644 (file)
@@ -427,7 +427,7 @@ static int hvcs_io(struct hvcs_struct *hvcsd)
        struct tty_struct *tty;
        char buf[HVCS_BUFF_LEN] __ALIGNED__;
        unsigned long flags;
-       int got;
+       int got = 0;
        int i;
 
        spin_lock_irqsave(&hvcsd->lock, flags);
@@ -945,7 +945,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,
  */
 struct hvcs_struct *hvcs_get_by_index(int index)
 {
-       struct hvcs_struct *hvcsd;
+       struct hvcs_struct *hvcsd = NULL;
        unsigned long flags;
 
        spin_lock(&hvcs_structs_lock);
@@ -1433,7 +1433,7 @@ static int __init hvcs_module_init(void)
                        " as a tty driver failed.\n");
                hvcs_free_index_list();
                put_tty_driver(hvcs_tty_driver);
-               return rc;
+               return -EIO;
        }
 
        hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);
index 61b00a1d8fc792c4866d982c1c19f5d8b5e6e71e..be0729dfb5a9747e7d3c2f1882aa2253a3bbacc2 100644 (file)
@@ -885,13 +885,16 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 
        mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0);
        if(!mac_addr_p) {
-               ibmveth_error_printk("Can't find VETH_MAC_ADDR attribute\n");
+               printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find VETH_MAC_ADDR "
+                               "attribute\n", __FILE__, __LINE__);
                return 0;
        }
        
        mcastFilterSize_p= (unsigned int *) vio_get_attribute(dev, VETH_MCAST_FILTER_SIZE, 0);
        if(!mcastFilterSize_p) {
-               ibmveth_error_printk("Can't find VETH_MCAST_FILTER_SIZE attribute\n");
+               printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find "
+                               "VETH_MCAST_FILTER_SIZE attribute\n",
+                               __FILE__, __LINE__);
                return 0;
        }
        
index 0f46404cee9aeb76d75f3c8643cfc92263190db6..1e679730da840febc8176c8383df2fe020d2a0ba 100644 (file)
@@ -449,7 +449,7 @@ static int rpaphp_disable_slot(struct pci_dev *dev)
 
 static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
-       int retval;
+       int retval = -EINVAL;
        struct slot *slot = (struct slot *)hotplug_slot->private;
 
        dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name);
index 219fb34aa4db1abc35f29f04198ff65edfade7e9..276b485d211be7099aef6927260a8a4a6b198cea 100644 (file)
@@ -186,7 +186,7 @@ static struct pci_dev *
 rpaphp_pci_config_slot(struct device_node *dn, struct pci_bus *bus)
 {
        struct device_node *eads_first_child = dn->child;
-       struct pci_dev *dev;
+       struct pci_dev *dev = NULL;
        int num;
        
        dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);