]> err.no Git - linux-2.6/commitdiff
bonding: fix two compiler warnings
authorJay Vosburgh <fubar@us.ibm.com>
Sat, 22 Mar 2008 05:29:34 +0000 (22:29 -0700)
committerJeff Garzik <jeff@garzik.org>
Wed, 26 Mar 2008 03:15:40 +0000 (23:15 -0400)
Fix two compiler warnings that are new with recent versions of gcc
(apparently 4.2 and up).  One is fixed by refactoring; this change was
supplied by Stephen Hemminger.  The other was fixed by labelling the
variable as uninitialized_var() after confirming via inspection that it
cannot actually be used uninitialized.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c

index b57bc9467dbe7a22d1c609fffa1ca5154daf9382..3f58c3d0b7106ae02452ff77f1e41c28ae2ded67 100644 (file)
@@ -678,12 +678,8 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
                }
 
                if (!list_empty(&bond->vlan_list)) {
-                       unsigned short vlan_id;
-                       int res = vlan_get_tag(skb, &vlan_id);
-                       if (!res) {
+                       if (!vlan_get_tag(skb, &client_info->vlan_id))
                                client_info->tag = 1;
-                               client_info->vlan_id = vlan_id;
-                       }
                }
 
                if (!client_info->assigned) {
index 0942d82f7cbf721f62c364941a13b31373668c5b..2056a872b4f385758cbda0b93515856abecead1a 100644 (file)
@@ -383,7 +383,7 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
  */
 int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev)
 {
-       unsigned short vlan_id;
+       unsigned short uninitialized_var(vlan_id);
 
        if (!list_empty(&bond->vlan_list) &&
            !(slave_dev->features & NETIF_F_HW_VLAN_TX) &&