* [PATCH] drivers/net/bonding: Adjust constant name
@ 2009-07-11 8:06 Julia Lawall
2009-07-11 20:03 ` Jay Vosburgh
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2009-07-11 8:06 UTC (permalink / raw)
To: fubar, bonding-devel, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
AD_STATE_LACP_ACTIVITY better reflects the intended semantics.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
struct port_params p;
@@
* p.port_state |= AD_SHORT_TIMEOUT
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/bonding/bond_3ad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d4b5708..88a1446 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1109,7 +1109,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
//mux machine in case of EXPIRED even if LINK_DOWN didn't arrive for the port.
port->partner_oper.port_state &= ~AD_STATE_SYNCHRONIZATION;
port->sm_vars &= ~AD_PORT_MATCHED;
- port->partner_oper.port_state |= AD_SHORT_TIMEOUT;
+ port->partner_oper.port_state |=
+ AD_STATE_LACP_ACTIVITY;
port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT));
port->actor_oper_port_state |= AD_STATE_EXPIRED;
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/net/bonding: Adjust constant name
2009-07-11 8:06 [PATCH] drivers/net/bonding: Adjust constant name Julia Lawall
@ 2009-07-11 20:03 ` Jay Vosburgh
2009-07-13 3:26 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Jay Vosburgh @ 2009-07-11 20:03 UTC (permalink / raw)
To: Julia Lawall
Cc: bonding-devel, linux-kernel, kernel-janitors, David S. Miller, netdev
From: Julia Lawall <julia@diku.dk>
AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
AD_STATE_LACP_ACTIVITY better reflects the intended semantics.
[ J adds: AD_STATE_LACP_ACTIVITY is a value defined by the standard, and
should be set here in accordance with 802.3ad 43.4.12; AD_SHORT_TIMEOUT
is a constant specific to the Linux 802.3ad implementation that happens
to have the same value ]
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
struct port_params p;
@@
* p.port_state |= AD_SHORT_TIMEOUT
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
---
drivers/net/bonding/bond_3ad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d4b5708..88a1446 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1109,7 +1109,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
//mux machine in case of EXPIRED even if LINK_DOWN didn't arrive for the port.
port->partner_oper.port_state &= ~AD_STATE_SYNCHRONIZATION;
port->sm_vars &= ~AD_PORT_MATCHED;
- port->partner_oper.port_state |= AD_SHORT_TIMEOUT;
+ port->partner_oper.port_state |=
+ AD_STATE_LACP_ACTIVITY;
port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT));
port->actor_oper_port_state |= AD_STATE_EXPIRED;
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/net/bonding: Adjust constant name
2009-07-11 20:03 ` Jay Vosburgh
@ 2009-07-13 3:26 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-07-13 3:26 UTC (permalink / raw)
To: fubar; +Cc: julia, bonding-devel, linux-kernel, kernel-janitors, netdev
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Sat, 11 Jul 2009 13:03:55 -0700
>
> From: Julia Lawall <julia@diku.dk>
>
> AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
> AD_STATE_LACP_ACTIVITY better reflects the intended semantics.
>
> [ J adds: AD_STATE_LACP_ACTIVITY is a value defined by the standard, and
> should be set here in accordance with 802.3ad 43.4.12; AD_SHORT_TIMEOUT
> is a constant specific to the Linux 802.3ad implementation that happens
> to have the same value ]
>
> The semantic match that finds this problem is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> struct port_params p;
> @@
> * p.port_state |= AD_SHORT_TIMEOUT
> // </smpl>
>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-13 3:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-11 8:06 [PATCH] drivers/net/bonding: Adjust constant name Julia Lawall
2009-07-11 20:03 ` Jay Vosburgh
2009-07-13 3:26 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®