Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/net/bonding: Adjust constant name

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Julia Lawall and committed by
David S. Miller
8e321c4f 440c1ce1

+2 -1
+2 -1
drivers/net/bonding/bond_3ad.c
··· 1109 1109 //mux machine in case of EXPIRED even if LINK_DOWN didn't arrive for the port. 1110 1110 port->partner_oper.port_state &= ~AD_STATE_SYNCHRONIZATION; 1111 1111 port->sm_vars &= ~AD_PORT_MATCHED; 1112 - port->partner_oper.port_state |= AD_SHORT_TIMEOUT; 1112 + port->partner_oper.port_state |= 1113 + AD_STATE_LACP_ACTIVITY; 1113 1114 port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT)); 1114 1115 port->actor_oper_port_state |= AD_STATE_EXPIRED; 1115 1116 break;