diff options
author | Thomas Haller <thaller@redhat.com> | 2018-06-13 14:24:26 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-15 09:46:26 +0200 |
commit | 8cba4d95df07b9f120765d5122a0b7ad1addb1f6 (patch) | |
tree | b6d056853560b67d2975546a025ef31d297bc1ff | |
parent | e7d26cd8712e7237112fc7ca1f8536ec9aac7c18 (diff) | |
download | NetworkManager-8cba4d95df07b9f120765d5122a0b7ad1addb1f6.tar.gz |
device/wifi: use _LOGD() macros in wake_on_wlan_enable()
_LOGD() is preferred, because it includes a common prefix depending
on the device. This macro requires, that we have a suitable @self
variable in the local scope.
-rw-r--r-- | src/devices/wifi/nm-device-wifi.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 5d03d7b79a..c10e5aeef9 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -2424,13 +2424,13 @@ error: /*****************************************************************************/ static gboolean -wake_on_wlan_enable (NMDevice *device) +wake_on_wlan_enable (NMDeviceWifi *self) { NMSettingWirelessWakeOnWLan wowl; NMSettingWireless *s_wireless; gs_free char *value = NULL; - s_wireless = (NMSettingWireless *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_WIRELESS); + s_wireless = (NMSettingWireless *) nm_device_get_applied_setting (NM_DEVICE (self), NM_TYPE_SETTING_WIRELESS); if (s_wireless) { wowl = nm_setting_wireless_get_wake_on_wlan (s_wireless); if (wowl != NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT) @@ -2439,7 +2439,7 @@ wake_on_wlan_enable (NMDevice *device) value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, "wifi.wake-on-wlan", - device); + NM_DEVICE (self)); if (value) { wowl = _nm_utils_ascii_str_to_int64 (value, 10, @@ -2449,12 +2449,12 @@ wake_on_wlan_enable (NMDevice *device) if (NM_FLAGS_ANY (wowl, NM_SETTING_WIRELESS_WAKE_ON_WLAN_EXCLUSIVE_FLAGS)) { if (!nm_utils_is_power_of_two (wowl)) { - nm_log_dbg (LOGD_WIFI, "invalid default value %u for wake-on-wlan: " - "'default' and 'ignore' are exclusive flags", (guint) wowl); + _LOGD (LOGD_WIFI, "invalid default value %u for wake-on-wlan: " + "'default' and 'ignore' are exclusive flags", (guint) wowl); wowl = NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT; } } else if (!NM_FLAGS_ANY (wowl, NM_SETTING_WIRELESS_WAKE_ON_WLAN_ALL)) { - nm_log_dbg (LOGD_WIFI, "invalid default value %u for wake-on-wlan", (guint) wowl); + _LOGD (LOGD_WIFI, "invalid default value %u for wake-on-wlan", (guint) wowl); wowl = NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT; } if (wowl != NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT) @@ -2462,7 +2462,7 @@ wake_on_wlan_enable (NMDevice *device) } wowl = NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE; found: - return nm_platform_wifi_set_wake_on_wlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), wowl); + return nm_platform_wifi_set_wake_on_wlan (NM_PLATFORM_GET, nm_device_get_ifindex (NM_DEVICE (self)), wowl); } static NMActStageReturn @@ -2658,7 +2658,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *out_failure_reason) s_wireless = nm_connection_get_setting_wireless (connection); g_assert (s_wireless); - wake_on_wlan_enable (device); + wake_on_wlan_enable (self); /* If we need secrets, get them */ setting_name = nm_connection_need_secrets (connection, NULL); @@ -3151,7 +3151,7 @@ reapply_connection (NMDevice *device, NMConnection *con_old, NMConnection *con_n _LOGD (LOGD_DEVICE, "reapplying wireless settings"); - wake_on_wlan_enable (device); + wake_on_wlan_enable (self); } /*****************************************************************************/ |