summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2024-01-27 14:26:50 +0100
committerDavid S. Miller <davem@davemloft.net>2024-01-31 12:30:47 +0000
commit285cc15cc555b4f05ebf2556bc6e85a6d36b790a (patch)
tree82898bee722bee83cc23354f4ae64dd52e113f86 /net
parent0b3100bc8fa7a05804737dba96075ea8d45316ce (diff)
downloadlinux-stable-285cc15cc555b4f05ebf2556bc6e85a6d36b790a.tar.gz
linux-stable-285cc15cc555b4f05ebf2556bc6e85a6d36b790a.tar.bz2
linux-stable-285cc15cc555b4f05ebf2556bc6e85a6d36b790a.zip
ethtool: adjust struct ethtool_keee to kernel needs
This patch changes the following in struct ethtool_keee - remove member cmd, it's not needed on kernel side - remove reserved fields - switch the semantically boolean members to type bool We don't have to change any user of the boolean members due to the implicit casting from/to bool. A small change is needed where a pointer to bool members is used, in addition remove few now unneeded double negations. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ethtool/eee.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ethtool/eee.c b/net/ethtool/eee.c
index 21b0e845a531..ac9f694ffe20 100644
--- a/net/ethtool/eee.c
+++ b/net/ethtool/eee.c
@@ -98,10 +98,10 @@ static int eee_fill_reply(struct sk_buff *skb,
if (ret < 0)
return ret;
- if (nla_put_u8(skb, ETHTOOL_A_EEE_ACTIVE, !!eee->eee_active) ||
- nla_put_u8(skb, ETHTOOL_A_EEE_ENABLED, !!eee->eee_enabled) ||
+ if (nla_put_u8(skb, ETHTOOL_A_EEE_ACTIVE, eee->eee_active) ||
+ nla_put_u8(skb, ETHTOOL_A_EEE_ENABLED, eee->eee_enabled) ||
nla_put_u8(skb, ETHTOOL_A_EEE_TX_LPI_ENABLED,
- !!eee->tx_lpi_enabled) ||
+ eee->tx_lpi_enabled) ||
nla_put_u32(skb, ETHTOOL_A_EEE_TX_LPI_TIMER, eee->tx_lpi_timer))
return -EMSGSIZE;
@@ -145,9 +145,9 @@ ethnl_set_eee(struct ethnl_req_info *req_info, struct genl_info *info)
link_mode_names, info->extack, &mod);
if (ret < 0)
return ret;
- 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_bool(&eee.eee_enabled, tb[ETHTOOL_A_EEE_ENABLED], &mod);
+ ethnl_update_bool(&eee.tx_lpi_enabled, tb[ETHTOOL_A_EEE_TX_LPI_ENABLED],
+ &mod);
ethnl_update_u32(&eee.tx_lpi_timer, tb[ETHTOOL_A_EEE_TX_LPI_TIMER],
&mod);
if (!mod)