diff mbox

[net-next-2.6] bonding: remove useless assignment

Message ID 4ACCF4D5.9050502@free.fr
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas de Pesloüan Oct. 7, 2009, 8:06 p.m. UTC
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.


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

Comments

Nicolas de Pesloüan Oct. 7, 2009, 8:24 p.m. UTC | #1
Nicolas de Pesloüan 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.
> 
> 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 */

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

	Nicolas.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 7, 2009, 8:54 p.m. UTC | #2
From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Date: Wed, 07 Oct 2009 22:06:45 +0200

> Resent after fixing tab to space corruption.

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

> diff --git 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)

Please fix this and resubmit.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 */