Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755690AbcKEPLw (ORCPT ); Sat, 5 Nov 2016 11:11:52 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35323 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755474AbcKEPLv (ORCPT ); Sat, 5 Nov 2016 11:11:51 -0400 From: Philippe Reynes To: dave@thedillows.org, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Philippe Reynes Subject: [PATCH] net: 3com: typhoon: fix typhoon_get_link_ksettings Date: Sat, 5 Nov 2016 16:11:40 +0100 Message-Id: <1478358700-22711-1-git-send-email-tremyfr@gmail.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1363 Lines: 41 When moving from typhoon_get_settings to typhoon_getlink_ksettings in the commit commit f7a5537cd2a5 ("net: 3com: typhoon: use new api ethtool_{get|set}_link_ksettings"), we use a local variable supported but we forgot to update the struct ethtool_link_ksettings with this value. We also initialize advertising to zero, because otherwise it may be uninitialized if no case of the switch (tp->xcvr_select) is used. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/3com/typhoon.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c index dbdf06f..a0cacbe 100644 --- a/drivers/net/ethernet/3com/typhoon.c +++ b/drivers/net/ethernet/3com/typhoon.c @@ -1000,7 +1000,7 @@ enum state_values { struct ethtool_link_ksettings *cmd) { struct typhoon *tp = netdev_priv(dev); - u32 supported, advertising; + u32 supported, advertising = 0; supported = SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_Autoneg; @@ -1049,6 +1049,11 @@ enum state_values { else cmd->base.autoneg = AUTONEG_DISABLE; + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, + supported); + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, + advertising); + return 0; } -- 1.7.4.4