]> err.no Git - linux-2.6/commitdiff
bonding: Remove unneeded list_empty checks.
authorPavel Emelyanov <xemul@openvz.org>
Sun, 18 May 2008 04:10:11 +0000 (21:10 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 22 May 2008 10:34:25 +0000 (06:34 -0400)
Some places iterate over the checked list right after the check
itself, so even if the list is empty, the list_for_each_xxx
iterator will make everything right by himself.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/bonding/bond_main.c

index 5e3b942fb515dc21caeec84a8a543fab494ac344..2a0039f193770d677a63fef13be00aa744f7a79e 100644 (file)
@@ -2433,9 +2433,6 @@ static int bond_has_this_ip(struct bonding *bond, __be32 ip)
        if (ip == bond->master_ip)
                return 1;
 
-       if (list_empty(&bond->vlan_list))
-               return 0;
-
        list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
                if (ip == vlan->vlan_ip)
                        return 1;
@@ -3495,9 +3492,6 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,
                        }
                }
 
-               if (list_empty(&bond->vlan_list))
-                       continue;
-
                list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
                        vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id);
                        if (vlan_dev == event_dev) {