Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bonding: fix two compiler warnings

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>

authored by

Jay Vosburgh and committed by
Jeff Garzik
966bc6f4 2bf86b7a

+2 -6
+1 -5
drivers/net/bonding/bond_alb.c
··· 678 678 } 679 679 680 680 if (!list_empty(&bond->vlan_list)) { 681 - unsigned short vlan_id; 682 - int res = vlan_get_tag(skb, &vlan_id); 683 - if (!res) { 681 + if (!vlan_get_tag(skb, &client_info->vlan_id)) 684 682 client_info->tag = 1; 685 - client_info->vlan_id = vlan_id; 686 - } 687 683 } 688 684 689 685 if (!client_info->assigned) {
+1 -1
drivers/net/bonding/bond_main.c
··· 383 383 */ 384 384 int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev) 385 385 { 386 - unsigned short vlan_id; 386 + unsigned short uninitialized_var(vlan_id); 387 387 388 388 if (!list_empty(&bond->vlan_list) && 389 389 !(slave_dev->features & NETIF_F_HW_VLAN_TX) &&