From patchwork Sat Jul 11 20:03:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Vosburgh X-Patchwork-Id: 29704 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 1180DB6F1F for ; Sun, 12 Jul 2009 06:04:03 +1000 (EST) Received: by ozlabs.org (Postfix) id 03EDADDDFB; Sun, 12 Jul 2009 06:04:03 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 82807DDDFA for ; Sun, 12 Jul 2009 06:04:02 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753662AbZGKUD4 (ORCPT ); Sat, 11 Jul 2009 16:03:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753543AbZGKUDz (ORCPT ); Sat, 11 Jul 2009 16:03:55 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:33583 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbZGKUDy (ORCPT ); Sat, 11 Jul 2009 16:03:54 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n6BK7C6T014054; Sat, 11 Jul 2009 16:07:12 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6BK3riG256140; Sat, 11 Jul 2009 16:03:53 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6BK3reU008171; Sat, 11 Jul 2009 16:03:53 -0400 Received: from death.nxdomain.ibm.com (sig-9-65-47-171.mts.ibm.com [9.65.47.171]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n6BK3pxf008158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Jul 2009 16:03:53 -0400 Received: from localhost ([127.0.0.1] helo=death.nxdomain.ibm.com) by death.nxdomain.ibm.com with esmtp (Exim 4.69) (envelope-from ) id 1MPinb-0002Oj-AV; Sat, 11 Jul 2009 13:03:55 -0700 From: Jay Vosburgh To: Julia Lawall cc: bonding-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH] drivers/net/bonding: Adjust constant name In-reply-to: References: Comments: In-reply-to Julia Lawall message dated "Sat, 11 Jul 2009 10:06:48 +0200." X-Mailer: MH-E 8.0.3; nmh 1.3-RC3; GNU Emacs 22.2.1 Date: Sat, 11 Jul 2009 13:03:55 -0700 Message-ID: <9220.1247342635@death.nxdomain.ibm.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Julia Lawall 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/) // @@ struct port_params p; @@ * p.port_state |= AD_SHORT_TIMEOUT // Signed-off-by: Julia Lawall Signed-off-by: Jay Vosburgh --- drivers/net/bonding/bond_3ad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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 --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;