mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 08:40:09 +01:00
device: remove duplicated checks when resetting ethtool settings
`_ethtool_*_reset()` functions already check that the state is not NULL, no need to check it before. The only exception was for "feature" settings, where the check was missing.
This commit is contained in:
parent
55d31ab11d
commit
48eaee471f
1 changed files with 7 additions and 10 deletions
|
|
@ -2385,6 +2385,8 @@ _ethtool_features_reset(NMDevice *self, NMPlatform *platform, EthtoolState *etht
|
|||
gs_free NMEthtoolFeatureStates *features = NULL;
|
||||
|
||||
features = g_steal_pointer(ðtool_state->features);
|
||||
if (!features)
|
||||
return;
|
||||
|
||||
if (!nm_platform_ethtool_set_features(platform,
|
||||
ethtool_state->ifindex,
|
||||
|
|
@ -2404,8 +2406,7 @@ _ethtool_features_set(NMDevice *self,
|
|||
{
|
||||
gs_free NMEthtoolFeatureStates *features = NULL;
|
||||
|
||||
if (ethtool_state->features)
|
||||
_ethtool_features_reset(self, platform, ethtool_state);
|
||||
_ethtool_features_reset(self, platform, ethtool_state);
|
||||
|
||||
if (nm_setting_ethtool_init_features(s_ethtool, ethtool_state->requested) == 0)
|
||||
return;
|
||||
|
|
@ -2719,14 +2720,10 @@ _ethtool_state_reset(NMDevice *self)
|
|||
if (!ethtool_state)
|
||||
return;
|
||||
|
||||
if (ethtool_state->features)
|
||||
_ethtool_features_reset(self, platform, ethtool_state);
|
||||
if (ethtool_state->coalesce)
|
||||
_ethtool_coalesce_reset(self, platform, ethtool_state);
|
||||
if (ethtool_state->ring)
|
||||
_ethtool_ring_reset(self, platform, ethtool_state);
|
||||
if (ethtool_state->pause)
|
||||
_ethtool_pause_reset(self, platform, ethtool_state);
|
||||
_ethtool_features_reset(self, platform, ethtool_state);
|
||||
_ethtool_coalesce_reset(self, platform, ethtool_state);
|
||||
_ethtool_ring_reset(self, platform, ethtool_state);
|
||||
_ethtool_pause_reset(self, platform, ethtool_state);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue