From: Jay Vosburgh <fubar@us.ibm.com>
To: netdev@vger.kernel.org
Cc: Jeff Garzik <jgarzik@pobox.com>, Pavel Emelyanov <xemul@openvz.org>
Subject: [PATCH 5/8] bonding: Remove unneeded list_empty checks.
Date: Sat, 17 May 2008 21:10:11 -0700 [thread overview]
Message-ID: <1211083817934-git-send-email-fubar@us.ibm.com> (raw)
In-Reply-To: <1211083816660-git-send-email-fubar@us.ibm.com>
From: Pavel Emelyanov <xemul@openvz.org>
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>
---
drivers/net/bonding/bond_main.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e3b942..2a0039f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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) {
--
1.5.2.4
next prev parent reply other threads:[~2008-05-18 4:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-18 4:10 [PATCH net-next-2.6 0/8] bonding: Fixes and updates Jay Vosburgh
[not found] ` <12110838151824-git-send-email-fubar@us.ibm.com>
2008-05-18 4:10 ` [PATCH 2/8] bonding: remove test for IP in ARP monitor Jay Vosburgh
2008-05-18 4:10 ` [PATCH 3/8] bonding: Remove redundant argument from bond_create Jay Vosburgh
2008-05-18 4:10 ` [PATCH 4/8] bonding: Relax unneeded _safe lists iterations Jay Vosburgh
2008-05-18 4:10 ` Jay Vosburgh [this message]
2008-05-18 4:10 ` [PATCH 6/8] bonding: Send more than one gratuitous ARP when slave takes over Jay Vosburgh
2008-05-18 4:10 ` [PATCH 7/8] bonding: refactor ARP active-backup monitor Jay Vosburgh
2008-05-18 4:10 ` [PATCH 8/8] bonding: Add "follow" option to fail_over_mac Jay Vosburgh
2008-05-22 11:09 ` Jeff Garzik
2008-05-20 21:54 ` [PATCH 6/8] bonding: Send more than one gratuitous ARP when slave takes over Andrew Morton
2008-05-20 21:46 ` [PATCH 3/8] bonding: Remove redundant argument from bond_create Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1211083817934-git-send-email-fubar@us.ibm.com \
--to=fubar@us.ibm.com \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).