netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] bonding: remove useless assignment
@ 2009-09-20 18:19 Nicolas de Pesloüan
  2009-10-05 14:52 ` Jiri Pirko
  2009-10-07  8:05 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas de Pesloüan @ 2009-09-20 18:19 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Jay Vosburgh, bonding-devel

The variable old_active is first set to bond->curr_active_slave.
Then, it is unconditionally set to new_active, without being used in between.

The first assignment, having no side effect, is useless.

Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>

---

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a7e731f..fce7233 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1084,7 +1084,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
         int mintime = bond->params.updelay;
         int i;

-       new_active = old_active = bond->curr_active_slave;
+       new_active = bond->curr_active_slave;

         if (!new_active) { /* there were no active slaves left */
                 if (bond->slave_cnt > 0)   /* found one slave */

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH net-next-2.6] bonding: remove useless assignment
@ 2009-10-07 20:06 Nicolas de Pesloüan
  2009-10-07 20:54 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas de Pesloüan @ 2009-10-07 20:06 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Jay Vosburgh, bonding-devel

The variable old_active is first set to bond->curr_active_slave.
Then, it is unconditionally set to new_active, without being used in between.

The first assignment, having no side effect, is useless.

Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>

---

Resent after fixing tab to space corruption.

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a7e731f..fce7233 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1084,7 +1084,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
	int mintime = bond->params.updelay;
	int i;

-	new_active = old_active = bond->curr_active_slave;
+	new_active = bond->curr_active_slave;

	if (!new_active) { /* there were no active slaves left */
		if (bond->slave_cnt > 0)   /* found one slave */


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-07 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-20 18:19 [PATCH net-next-2.6] bonding: remove useless assignment Nicolas de Pesloüan
2009-10-05 14:52 ` Jiri Pirko
2009-10-07  8:05 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-10-07 20:06 Nicolas de Pesloüan
2009-10-07 20:54 ` David Miller

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).