From 399c26f55f32913cb55e441b5bcf10e101693bd9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 6 Jul 2016 09:32:42 +0200 Subject: [PATCH] wifi: minor cleanups for boolean variables --- src/devices/wifi/nm-device-wifi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index bfd6d0217e..37ec4a6128 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -99,20 +99,20 @@ struct _NMDeviceWifiPrivate { GHashTable * aps; NMAccessPoint * current_ap; guint32 rate; - gboolean enabled; /* rfkilled or not */ + bool enabled:1; /* rfkilled or not */ + bool requested_scan:1; + bool ssid_found:1; gint32 last_scan; gint32 scheduled_scan_time; guint8 scan_interval; /* seconds */ guint pending_scan_id; guint ap_dump_id; - bool requested_scan; NMSupplicantManager *sup_mgr; NMSupplicantInterface *sup_iface; guint sup_timeout_id; /* supplicant association timeout */ - bool ssid_found; NM80211Mode mode; guint periodic_source_id; @@ -2924,6 +2924,8 @@ set_enabled (NMDevice *device, gboolean enabled) NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); NMDeviceState state; + enabled = !!enabled; + if (priv->enabled == enabled) return;