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

* Re: [PATCH net-next-2.6] bonding: remove useless assignment
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2009-10-05 14:52 UTC (permalink / raw)
  To: Nicolas de Pesloüan
  Cc: netdev, David Miller, Jay Vosburgh, bonding-devel

Sun, Sep 20, 2009 at 08:19:46PM CEST, nicolas.2p.debian@free.fr 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.

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

Reviewed-by: Jiri Pirko <jpirko@redhat.com>

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

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

* Re: [PATCH net-next-2.6] bonding: remove useless assignment
  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
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2009-10-07  8:05 UTC (permalink / raw)
  To: nicolas.2p.debian; +Cc: netdev, fubar, bonding-devel

From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Date: Sun, 20 Sep 2009 20:19:46 +0200

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

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.

^ permalink raw reply	[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

* Re: [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, 0 replies; 5+ messages in thread
From: David Miller @ 2009-10-07 20:54 UTC (permalink / raw)
  To: nicolas.2p.debian; +Cc: netdev, fubar, bonding-devel

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.

^ permalink raw reply	[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).