From 26121eff14b02ad69e4e76d1fd6bee9f44f1bcf1 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 5 Feb 2018 20:36:59 +0100 Subject: [PATCH] device: don't return value from _device_activate() It was only used at one place for an assertion. And it's not clear that the assertion always holds. (cherry picked from commit 9c094f93fb665fb68807960879dcd341b6f3dd6a) --- src/devices/nm-device.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 2dff80f21d..9f74d4da65 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -9961,26 +9961,26 @@ impl_device_delete (NMDevice *self, GDBusMethodInvocation *context) NULL); } -static gboolean +static void _device_activate (NMDevice *self, NMActRequest *req) { NMDevicePrivate *priv; NMConnection *connection; - g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); - g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); - g_return_val_if_fail (nm_device_get_managed (self, FALSE), FALSE); + g_return_if_fail (NM_IS_DEVICE (self)); + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + g_return_if_fail (nm_device_get_managed (self, FALSE)); /* Ensure the activation request is still valid; the master may have * already failed in which case activation of this device should not proceed. */ if (nm_active_connection_get_state (NM_ACTIVE_CONNECTION (req)) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) - return FALSE; + return; priv = NM_DEVICE_GET_PRIVATE (self); connection = nm_act_request_get_applied_connection (req); - g_assert (connection); + nm_assert (connection); _LOGI (LOGD_DEVICE, "Activation: starting connection '%s' (%s)", nm_connection_get_id (connection), @@ -9991,7 +9991,6 @@ _device_activate (NMDevice *self, NMActRequest *req) act_request_set (self, req); nm_device_activate_schedule_stage1_device_prepare (self); - return TRUE; } static void @@ -10087,10 +10086,10 @@ nm_device_queue_activation (NMDevice *self, NMActRequest *req) must_queue = _carrier_wait_check_act_request_must_queue (self, req); - if (!priv->act_request && !must_queue && nm_device_is_real (self)) { - /* Just activate immediately */ - if (!_device_activate (self, req)) - g_assert_not_reached (); + if ( !priv->act_request + && !must_queue + && nm_device_is_real (self)) { + _device_activate (self, req); return; }