diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-07-06 21:44:06 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-07-07 14:55:42 +0200 |
commit | a37de604c7adc4faad0cf1a5c0cf6dc5ed7fe672 (patch) | |
tree | 27a30e55d5000bb4345a6b2651a4a98018e03b20 | |
parent | c686316c22258d4e2798770b398d40171d8eb9f0 (diff) | |
download | NetworkManager-bg/update-dev-state-file-rh1593282.tar.gz |
manager: use NM_IN_SET()bg/update-dev-state-file-rh1593282
No functional change.
-rw-r--r-- | src/nm-manager.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index 5ee44ede83..966ecc2a89 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1459,17 +1459,13 @@ manager_device_state_changed (NMDevice *device, && new_state > NM_DEVICE_STATE_UNMANAGED) retry_connections_for_parent_device (self, device); - switch (new_state) { - case NM_DEVICE_STATE_UNMANAGED: - case NM_DEVICE_STATE_UNAVAILABLE: - case NM_DEVICE_STATE_DISCONNECTED: - case NM_DEVICE_STATE_PREPARE: - case NM_DEVICE_STATE_FAILED: + if (NM_IN_SET (new_state, + NM_DEVICE_STATE_UNMANAGED, + NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_PREPARE, + NM_DEVICE_STATE_FAILED)) _notify (self, PROP_ACTIVE_CONNECTIONS); - break; - default: - break; - } if (NM_IN_SET (new_state, NM_DEVICE_STATE_UNMANAGED, @@ -1477,8 +1473,9 @@ manager_device_state_changed (NMDevice *device, NM_DEVICE_STATE_ACTIVATED)) nm_manager_write_device_state (self, device); - if ( new_state == NM_DEVICE_STATE_UNAVAILABLE - || new_state == NM_DEVICE_STATE_DISCONNECTED) + if (NM_IN_SET (new_state, + NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_DISCONNECTED)) nm_settings_device_added (priv->settings, device); } |