bonding: remove useless assignment
Subsystems (3)
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
@@ -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 */Quoted 17 lines · Nicolas de Pesloüan
The variable
old_activeis first set tobond->curr_active_slave. Then, it is unconditionally set tonew_active, without being used in between.The first assignment, having no side effect, is useless.
Signed-off-by Nicolas de Pesloüan <[email protected]>Reviewed-by Jiri Pirko <[email protected]>---
Resent after fixing tab to space corruption.
drivers/net/bonding/bond_main.c +0
-0
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.
David Miller
maintainerFrom: 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.