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 9c094f93fb)
This commit is contained in:
Thomas Haller 2018-02-05 20:36:59 +01:00
parent c7b1d4a2d3
commit 26121eff14

View file

@ -9961,26 +9961,26 @@ impl_device_delete (NMDevice *self, GDBusMethodInvocation *context)
NULL); NULL);
} }
static gboolean static void
_device_activate (NMDevice *self, NMActRequest *req) _device_activate (NMDevice *self, NMActRequest *req)
{ {
NMDevicePrivate *priv; NMDevicePrivate *priv;
NMConnection *connection; NMConnection *connection;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_if_fail (NM_IS_DEVICE (self));
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); g_return_if_fail (NM_IS_ACT_REQUEST (req));
g_return_val_if_fail (nm_device_get_managed (self, FALSE), FALSE); g_return_if_fail (nm_device_get_managed (self, FALSE));
/* Ensure the activation request is still valid; the master may have /* Ensure the activation request is still valid; the master may have
* already failed in which case activation of this device should not proceed. * 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) if (nm_active_connection_get_state (NM_ACTIVE_CONNECTION (req)) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING)
return FALSE; return;
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
connection = nm_act_request_get_applied_connection (req); connection = nm_act_request_get_applied_connection (req);
g_assert (connection); nm_assert (connection);
_LOGI (LOGD_DEVICE, "Activation: starting connection '%s' (%s)", _LOGI (LOGD_DEVICE, "Activation: starting connection '%s' (%s)",
nm_connection_get_id (connection), nm_connection_get_id (connection),
@ -9991,7 +9991,6 @@ _device_activate (NMDevice *self, NMActRequest *req)
act_request_set (self, req); act_request_set (self, req);
nm_device_activate_schedule_stage1_device_prepare (self); nm_device_activate_schedule_stage1_device_prepare (self);
return TRUE;
} }
static void 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); must_queue = _carrier_wait_check_act_request_must_queue (self, req);
if (!priv->act_request && !must_queue && nm_device_is_real (self)) { if ( !priv->act_request
/* Just activate immediately */ && !must_queue
if (!_device_activate (self, req)) && nm_device_is_real (self)) {
g_assert_not_reached (); _device_activate (self, req);
return; return;
} }