Skip to contentSkip to conversation

bonding: remove useless assignment

PATCH In review Nicolas de Pesloüan 2 participants 3 messages Oct 7, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: remove useless assignment

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.

---

Resent after fixing tab to space corruption.

drivers/net/bonding/bond_main.c +0 -0
index a7e731f..fce7233 100644
@@ -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 */
#1 lore raw
Quoted 17 lines · Nicolas de Pesloüan

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.

---

Resent after fixing tab to space corruption.

drivers/net/bonding/bond_main.c +0 -0
index a7e731f..fce7233 100644

drivers/net/bonding/bond_main.c static struct slave *bond_find_best_slave(struct bonding *bond) · line 1090

Quoted 8 lines
drivers/net/bonding/bond_main.c +1 -1
@@ -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 */

Apparently still some issues with patch formating. I will investigate this and post later.

Nicolas.

maintainer
#2 lore raw
In reply to Nicolas de Pesloüan

From: Nicolas de Pesloüan <[email protected]>
Date: Wed, 07 Oct 2009 22:06:45 +0200

Quoted 1 line

Resent after fixing tab to space corruption.

It's still breaking up long lines, two examples:

Quoted 2 lines
drivers/net/bonding/bond_main.c +0 -0

...

drivers/net/bonding/bond_main.c static struct slave *bond_find_best_slave(struct · line 1084

Quoted 2 lines
drivers/net/bonding/bond_main.c +0 -0
@@ -1084,7 +1084,7 @@ static struct slave *bond_find_best_slave(struct
 bonding *bond)

Please fix this and resubmit.