Skip to content

Commit

Permalink
bonding: Remove unneeded list_empty checks.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and Jeff Garzik committed May 22, 2008
1 parent 0883bec commit 8047637
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8047637

Please sign in to comment.