From 5151a6071f023dc8dc2c4e64cfe84a1f8af740e8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 2 Feb 2017 12:28:32 +0100 Subject: [PATCH] device: inline device helper structs QueuedState and PingInfo These two structs are only used at exactly one place: as the type for a field in NMDevicePrivate. Having additional structs (that are only used at one place) only add noise. Also, there are already prior-acts of using unnamed structs in NMDevicePrivate in case of structs that only serve to group/namespace a set of fields. --- src/devices/nm-device.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index e383311698..4006e2c5d2 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -164,12 +164,6 @@ typedef enum { IP_FAIL } IpState; -typedef struct { - NMDeviceState state; - NMDeviceStateReason reason; - guint id; -} QueuedState; - typedef struct { NMDevice *slave; gulong watch_id; @@ -177,16 +171,6 @@ typedef struct { bool configure; } SlaveInfo; -typedef struct { - NMLogDomain log_domain; - guint timeout; - guint watch; - GPid pid; - const char *binary; - const char *address; - guint deadline; -} PingInfo; - typedef struct { NMDevice *device; guint idle_add_id; @@ -216,7 +200,11 @@ typedef struct _NMDevicePrivate { NMDeviceState state; NMDeviceStateReason state_reason; - QueuedState queued_state; + struct { + NMDeviceState state; + NMDeviceStateReason reason; + guint id; + } queued_state; guint queued_ip4_config_id; guint queued_ip6_config_id; GSList *pending_actions; @@ -354,7 +342,15 @@ typedef struct _NMDevicePrivate { guint num_tries_left; } dhcp4; - PingInfo gw_ping; + struct { + NMLogDomain log_domain; + guint timeout; + guint watch; + GPid pid; + const char *binary; + const char *address; + guint deadline; + } gw_ping; /* dnsmasq stuff for shared connections */ NMDnsMasqManager *dnsmasq_manager;