From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F16ECC2BB9A for ; Tue, 15 Dec 2020 16:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9A31225A9 for ; Tue, 15 Dec 2020 16:50:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731262AbgLOQuZ (ORCPT ); Tue, 15 Dec 2020 11:50:25 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57441 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731232AbgLOQuJ (ORCPT ); Tue, 15 Dec 2020 11:50:09 -0500 X-Originating-IP: 86.202.109.140 Received: from localhost (lfbn-lyo-1-13-140.w86-202.abo.wanadoo.fr [86.202.109.140]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 3CD7060007; Tue, 15 Dec 2020 16:49:26 +0000 (UTC) Date: Tue, 15 Dec 2020 17:49:25 +0100 From: Alexandre Belloni To: Vladimir Oltean Cc: Tobias Waldekranz , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vivien Didelot , Claudiu Manoil Subject: Re: [RFC PATCH net-next 09/16] net: mscc: ocelot: use "lag" variable name in ocelot_bridge_stp_state_set Message-ID: <20201215164925.GM1781038@piout.net> References: <20201208120802.1268708-1-vladimir.oltean@nxp.com> <20201208120802.1268708-10-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201208120802.1268708-10-vladimir.oltean@nxp.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 08/12/2020 14:07:55+0200, Vladimir Oltean wrote: > In anticipation of further simplification, make it more clear what we're > iterating over. > > Signed-off-by: Vladimir Oltean Reviewed-by: Alexandre Belloni > --- > drivers/net/ethernet/mscc/ocelot.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c > index 080fd4ce37ea..c3c6682e6e79 100644 > --- a/drivers/net/ethernet/mscc/ocelot.c > +++ b/drivers/net/ethernet/mscc/ocelot.c > @@ -903,7 +903,7 @@ void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state) > { > struct ocelot_port *ocelot_port = ocelot->ports[port]; > u32 port_cfg; > - int p, i; > + int p; > > if (!(BIT(port) & ocelot->bridge_mask)) > return; > @@ -928,14 +928,17 @@ void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state) > ocelot_write_gix(ocelot, port_cfg, ANA_PORT_PORT_CFG, port); > > /* Apply FWD mask. The loop is needed to add/remove the current port as > - * a source for the other ports. > + * a source for the other ports. If the source port is in a bond, then > + * all the other ports from that bond need to be removed from this > + * source port's forwarding mask. > */ > for (p = 0; p < ocelot->num_phys_ports; p++) { > if (ocelot->bridge_fwd_mask & BIT(p)) { > unsigned long mask = ocelot->bridge_fwd_mask & ~BIT(p); > + int lag; > > - for (i = 0; i < ocelot->num_phys_ports; i++) { > - unsigned long bond_mask = ocelot->lags[i]; > + for (lag = 0; lag < ocelot->num_phys_ports; lag++) { > + unsigned long bond_mask = ocelot->lags[lag]; > > if (!bond_mask) > continue; > -- > 2.25.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com