From f4de6734a968146edff5431ca812ebf1c00c8847 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 14 May 2017 09:45:53 +0200 Subject: [PATCH] device: remove function nm_device_is_enslaved() There were only two callers. Let them access the field directly. --- src/devices/nm-device-private.h | 2 -- src/devices/nm-device.c | 17 ++--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index a1e4724254..1081580c48 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -91,8 +91,6 @@ gboolean nm_device_dhcp6_renew (NMDevice *device, gboolean release); void nm_device_recheck_available_connections (NMDevice *device); -gboolean nm_device_get_enslaved (NMDevice *device); - void nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave, NMLogDomain log_domain); diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 74733cb932..a38298558a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2198,7 +2198,7 @@ carrier_changed (NMDevice *self, gboolean carrier) nm_device_activate_stage3_ip6_start (self); return; - } else if (nm_device_get_enslaved (self) && !carrier) { + } else if (priv->is_enslaved && !carrier) { /* Slaves don't deactivate when they lose carrier; for * bonds/teams in particular that would be actively * counterproductive. @@ -3653,19 +3653,6 @@ nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason) } } -/** - * nm_device_get_enslaved: - * @self: the #NMDevice - * - * Returns: %TRUE if the device is enslaved to a master device (eg bridge or - * bond or team), %FALSE if not - */ -gboolean -nm_device_get_enslaved (NMDevice *self) -{ - return NM_DEVICE_GET_PRIVATE (self)->is_enslaved; -} - /** * nm_device_removed: * @self: the #NMDevice @@ -6009,7 +5996,7 @@ have_any_ready_slaves (NMDevice *self, const GSList *slaves) * properties set up. */ for (iter = slaves; iter; iter = g_slist_next (iter)) { - if (nm_device_get_enslaved (iter->data)) + if (NM_DEVICE_GET_PRIVATE (NM_DEVICE (iter->data))->is_enslaved) return TRUE; } return FALSE;