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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F1EEECAAA3 for ; Fri, 26 Aug 2022 07:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245645AbiHZHwE (ORCPT ); Fri, 26 Aug 2022 03:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245610AbiHZHwB (ORCPT ); Fri, 26 Aug 2022 03:52:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7BBD347E for ; Fri, 26 Aug 2022 00:52:00 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRU8E-0001SH-B3; Fri, 26 Aug 2022 09:51:58 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oRU8E-0004tJ-0G; Fri, 26 Aug 2022 09:51:58 +0200 Date: Fri, 26 Aug 2022 09:51:57 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: Woojung Huh , Andrew Lunn , Arun Ramadoss , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vivien Didelot , Eric Dumazet , Paolo Abeni , kernel@pengutronix.de, Jakub Kicinski , UNGLinuxDriver@microchip.com, "David S. Miller" Subject: Re: [PATCH net-next v3 15/17] net: dsa: microchip: ksz9477: remove unused "on" variable Message-ID: <20220826075157.GD2116@pengutronix.de> References: <20220823080231.2466017-1-o.rempel@pengutronix.de> <20220823080231.2466017-16-o.rempel@pengutronix.de> <20220825205407.jayiksjrnccpknoj@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220825205407.jayiksjrnccpknoj@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2022 at 11:54:07PM +0300, Vladimir Oltean wrote: > On Tue, Aug 23, 2022 at 10:02:29AM +0200, Oleksij Rempel wrote: > > This variable is not used on ksz9477 side. Remove it. > > > > Signed-off-by: Oleksij Rempel > > --- > > drivers/net/dsa/microchip/ksz9477.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c > > index bfefb60ec91bf..609bd63f4cdb1 100644 > > --- a/drivers/net/dsa/microchip/ksz9477.c > > +++ b/drivers/net/dsa/microchip/ksz9477.c > > @@ -1070,7 +1070,6 @@ void ksz9477_config_cpu_port(struct dsa_switch *ds) > > > > /* enable cpu port */ > > ksz9477_port_setup(dev, i, true); > > - p->on = 1; > > } > > } > > > > @@ -1080,7 +1079,6 @@ void ksz9477_config_cpu_port(struct dsa_switch *ds) > > p = &dev->ports[i]; > > > > ksz_port_stp_state_set(ds, i, BR_STATE_DISABLED); > > - p->on = 1; > > if (dev->chip_id == 0x00947700 && i == 6) { > > p->sgmii = 1; > > } > > -- > > 2.30.2 > > > > And it seems like it's not used on ksz8 either. The reason I'm saying > that is that ksz8_flush_dyn_mac_table() is the only apparent user of > p->on, and that only for the case where flushing the FDB of all ports is > requested (port > dev->info->port_cnt). But ksz8_flush_dyn_mac_table() > (through dev->dev_ops->flush_dyn_mac_table) is only called from DSA's > ds->ops->port_fast_age() method, and that will never be requested > "for all ports" (and to my knowledge never was in the past, either). > Badly ported SDK code would be my guess. So there are more > simplifications which could be done. Ok, i'll take a look on it as soon as i get one of ksz8 board in my fingers. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |