Skip to contentSkip to conversation

bonding: remove useless assignment

PATCH In review Nicolas de Pesloüan 3 participants 3 messages Sep 20, 2009 – 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.

---

drivers/net/bonding/bond_main.c +1 -1
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 */
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Sun, Sep 20, 2009 at 08:19:46PM CEST, [email protected] wrote:

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.

Correct.

Quoted 2 lines
Quoted 20 lines

---

drivers/net/bonding/bond_main.c +1 -2
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 */
--

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

From: Nicolas de Pesloüan <[email protected]>
Date: Sun, 20 Sep 2009 20:19:46 +0200

Quoted 7 lines

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.

Nicolas, all of your patches are corrupts by your email client. It breaks up long lines and transforms tab characters into spaces.

Please correct this, and resubmit all of your pending patches.

Thank you.