Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751769AbdGaWVf (ORCPT ); Mon, 31 Jul 2017 18:21:35 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:33628 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbdGaWUV (ORCPT ); Mon, 31 Jul 2017 18:20:21 -0400 From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Vivien Didelot Subject: [PATCH net-next 04/11] net: dsa: qca8k: do not cache unneeded EEE fields Date: Mon, 31 Jul 2017 18:17:12 -0400 Message-Id: <20170731221719.16695-5-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170731221719.16695-1-vivien.didelot@savoirfairelinux.com> References: <20170731221719.16695-1-vivien.didelot@savoirfairelinux.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1428 Lines: 47 The qca8k driver is currently caching a bitfield of the supported member of a ethtool_eee private structure, which is unused. Only the eee_enabled field of the private ethtool_eee copy is updated, thus using p->advertised and p->lp_advertised is also erroneous. Remove the usage of these private ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 9d6b5d2f7a4a..c316c55aabc6 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -658,12 +658,8 @@ static int qca8k_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) { - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - struct ethtool_eee *p = &priv->port_sts[port].eee; int ret; - p->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full); - ret = phy_init_eee(phy, 0); if (ret) return 0; @@ -705,12 +701,7 @@ qca8k_get_eee(struct dsa_switch *ds, int port, int ret; ret = phy_ethtool_get_eee(netdev->phydev, p); - if (!ret) - e->eee_active = - !!(p->supported & p->advertised & p->lp_advertised); - else - e->eee_active = 0; - + e->eee_active = p->eee_active; e->eee_enabled = p->eee_enabled; return ret; -- 2.13.3