* [PATCH] net: 3com: typhoon: fix typhoon_get_link_ksettings
@ 2016-11-05 15:11 Philippe Reynes
2016-11-06 9:53 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Reynes @ 2016-11-05 15:11 UTC (permalink / raw)
To: dave, davem; +Cc: netdev, linux-kernel, Philippe Reynes
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 <tremyfr@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: 3com: typhoon: fix typhoon_get_link_ksettings
2016-11-05 15:11 [PATCH] net: 3com: typhoon: fix typhoon_get_link_ksettings Philippe Reynes
@ 2016-11-06 9:53 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2016-11-06 9:53 UTC (permalink / raw)
To: Philippe Reynes, dave, davem; +Cc: netdev, linux-kernel
Hello.
On 11/5/2016 6:11 PM, Philippe Reynes wrote:
> When moving from typhoon_get_settings to typhoon_getlink_ksettings
> in the commit commit f7a5537cd2a5 ("net: 3com: typhoon: use new api
One "commit" is enough. :-)
> 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 <tremyfr@gmail.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-06 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-05 15:11 [PATCH] net: 3com: typhoon: fix typhoon_get_link_ksettings Philippe Reynes
2016-11-06 9:53 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).