netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: Jay Vosburgh <fubar@us.ibm.com>, David Miller <davem@davemloft.net>
Cc: bonding-devel@lists.sourceforge.net,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH 7/8][BONDING]: Remove unneeded list_empty checks.
Date: Tue, 29 Apr 2008 19:06:54 +0400	[thread overview]
Message-ID: <4817398E.7070806@openvz.org> (raw)
In-Reply-To: <481735F4.30909@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>

---
 drivers/net/bonding/bond_main.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8623e47..4d852ab 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2433,9 +2433,6 @@ static int bond_has_ip(struct bonding *bond)
 	if (bond->master_ip)
 		return 1;
 
-	if (list_empty(&bond->vlan_list))
-		return 0;
-
 	list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
 		if (vlan->vlan_ip)
 			return 1;
@@ -2451,9 +2448,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;
@@ -3520,9 +3514,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.3.4


  parent reply	other threads:[~2008-04-29 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 14:51 [PATCH 0/8][BONDING]: Some BUGs and deadlocks fixes and a bit of concomitant cleanups Pavel Emelyanov
2008-04-29 14:54 ` [PATCH 1/8][BONDING]: Do not call free_netdev for already registered device Pavel Emelyanov
2008-04-29 14:56 ` [PATCH 2/8][BONDING]: Don't create bondings with % in their names Pavel Emelyanov
2008-04-29 14:58 ` [PATCH 3/8][BONDING]: Merge two calls to dev_alloc_name Pavel Emelyanov
2008-04-29 15:01 ` [PATCH 4/8][BONDING]: Remove redundant argument from bond_create Pavel Emelyanov
2008-04-29 15:02 ` [PATCH 5/8][BONDING]: Lost semaphores unlock in one of bonding_store_bonds error paths Pavel Emelyanov
2008-04-29 15:05 ` [PATCH 6/8][BONDING]: Relax unneeded _safe lists iterations Pavel Emelyanov
2008-04-29 15:06 ` Pavel Emelyanov [this message]
2008-04-29 15:11 ` [PATCH 8/8][BONDING]: Deadlock between bonding_store_bonds and bond_destroy_sysfs Pavel Emelyanov
2008-05-03  0:06 ` [PATCH 0/8][BONDING]: Some BUGs and deadlocks fixes and a bit of concomitant cleanups David Miller
2008-05-03  0:25   ` Jay Vosburgh

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=4817398E.7070806@openvz.org \
    --to=xemul@openvz.org \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.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).