summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-12-21 11:11:46 +0100
committerThomas Haller <thaller@redhat.com>2017-12-21 11:11:47 +0100
commitc1fbf7ee86dac7fe5bc19d72293553d3fdbc2e17 (patch)
tree44ce6d95a03b9b1db84aa37776c6edba478f9276
parenta6c3ffd62e4ec16710c2047bce990e751f398922 (diff)
downloadNetworkManager-c1fbf7ee86dac7fe5bc19d72293553d3fdbc2e17.tar.gz
iwd: fix coding style to use curly braces for multi-line if()
Our convention is that when the body of an if() or for() spawns more then one line, then it needs curly braces. If it's only one line, it should have no curly braces. The latter part seems sometimes a bit inconvenient, because changing if (some_condition) do_something (); gets change to if (some_condition) { do_something (); do_something_else (); } the diff shows 3 lines changed, although really only one changed. But well, that's how it is...
-rw-r--r--src/devices/wifi/nm-device-iwd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c
index 0c36af7bdf..36e9fe440c 100644
--- a/src/devices/wifi/nm-device-iwd.c
+++ b/src/devices/wifi/nm-device-iwd.c
@@ -496,9 +496,10 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
/* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks.
*/
- if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X)
+ if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
+ }
return TRUE;
}
@@ -536,9 +537,10 @@ check_connection_available (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks.
*/
- if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X)
+ if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
+ }
/* a connection that is available for a certain @specific_object, MUST
* also be available in general (without @specific_object). */
@@ -670,7 +672,7 @@ complete_connection (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks.
*/
- if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X)
+ if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection)) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
@@ -678,6 +680,7 @@ complete_connection (NMDevice *device,
"This 8021x network has not been provisioned on this machine");
return FALSE;
}
+ }
perm_hw_addr = nm_device_get_permanent_hw_address (device);
if (perm_hw_addr) {
@@ -756,9 +759,10 @@ can_auto_connect (NMDevice *device,
/* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks.
*/
- if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X)
+ if (get_connection_iwd_security (connection) == NM_IWD_NETWORK_SECURITY_8021X) {
if (!is_connection_known_network (connection))
return FALSE;
+ }
ap = nm_wifi_aps_find_first_compatible (priv->aps, connection, FALSE);
if (ap) {