ethtool: fix incorrect datatype in set_eee ops
Subsystems (4)
PATCH 1/1 ethtool: fix incorrect datatype in set_eee ops
The member 'tx_lpi_timer' is defined with __u32 datatype in the ethtool header file. Hence, we should use ethnl_update_u32() in set_eee ops.
--- net/ethtool/eee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ethtool/eee.c +2 -2
@@ -169,8 +169,8 @@ int ethnl_set_eee(struct sk_buff *skb, struct genl_info *info)ethnl_update_bool32 (&eee.eee_enabled, tb[ETHTOOL_A_EEE_ENABLED ], &mod);ethnl_update_bool32 (&eee.tx_lpi_enabled, tb[ETHTOOL_A_EEE_TX_LPI_ENABLED ], &mod); -ethnl_update_bool32 (&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER ], - &mod); +ethnl_update_u32 (&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER ], + &mod); ret =0 ;if (!mod) goto out_ops;
Signature · 1 line
2.25.1
Quoted 7 lines · On Tue, 6 Apr 2021 21:17:30 +0800 Wong Vee Khee wrote:
The member '
tx_lpi_timer' is defined with__u32datatype in the ethtool header file. Hence, we should useethnl_update_u32()inset_eeeops.Fixes fd77be7bd43c ("ethtool: set EEE settings with EEE_SET request")Cc <[email protected]> # 5.10.xCc Michal Kubecek <[email protected]>Signed-off-by Wong Vee Khee <[email protected]>
Quoted 2 lines · Wong Vee Khee
The member '
tx_lpi_timer' is defined with__u32datatype in the ethtool header file. Hence, we should useethnl_update_u32()inset_eeeops.
To be precise, the correct reason is that unlike .eee_enabled and .tx_lpi_enabled, .tx_lpi_timer value is interpreted as a number, not a logical value (those two are also __u32). But I don't think it's necessary to resubmit.
Quoted 26 lines
Fixes fd77be7bd43c ("ethtool: set EEE settings with EEE_SET request")Cc <[email protected]> # 5.10.xCc Michal Kubecek <[email protected]>Signed-off-by Wong Vee Khee <[email protected]>--- net/ethtool/eee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/ethtool/eee.c +2
-2@@ -169,8 +169,8 @@ int ethnl_set_eee(struct sk_buff *skb, struct genl_info *info)ethnl_update_bool32 (&eee.eee_enabled, tb[ETHTOOL_A_EEE_ENABLED ], &mod);ethnl_update_bool32 (&eee.tx_lpi_enabled, tb[ETHTOOL_A_EEE_TX_LPI_ENABLED ], &mod); -ethnl_update_bool32 (&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER ], - &mod); +ethnl_update_u32 (&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER ], + &mod); ret =0 ;if (!mod) goto out_ops;Signature · 1 line
2.25.1
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 9 lines · On Tue, 6 Apr 2021 21:17:30 +0800 you wrote:
The member '
tx_lpi_timer' is defined with__u32datatype in the ethtool header file. Hence, we should useethnl_update_u32()inset_eeeops.Fixes fd77be7bd43c ("ethtool: set EEE settings with EEE_SET request")Cc <[email protected]> # 5.10.xCc Michal Kubecek <[email protected]>Signed-off-by Wong Vee Khee <[email protected]>[...]
Here is the summary with links:
- [net,v1,1/1] ethtool: fix incorrect datatype in set_eee ops
https://git.kernel.org/netdev/net/c/63cf32389925
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html