From 614f4733e20082397d50da89957492d95ea55131 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 6 Jul 2018 21:44:06 +0200 Subject: [PATCH] manager: use NM_IN_SET() No functional change. --- src/nm-manager.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index eeaefccb45..003536a3e3 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); }