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...
This commit is contained in:
Thomas Haller 2017-12-21 11:11:46 +01:00
parent a6c3ffd62e
commit c1fbf7ee86

View file

@ -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 /* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks. * 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)) if (!is_connection_known_network (connection))
return FALSE; return FALSE;
}
return TRUE; 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 /* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks. * 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)) if (!is_connection_known_network (connection))
return FALSE; return FALSE;
}
/* a connection that is available for a certain @specific_object, MUST /* a connection that is available for a certain @specific_object, MUST
* also be available in general (without @specific_object). */ * 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 /* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks. * 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)) { if (!is_connection_known_network (connection)) {
g_set_error_literal (error, g_set_error_literal (error,
NM_CONNECTION_ERROR, NM_CONNECTION_ERROR,
@ -678,6 +680,7 @@ complete_connection (NMDevice *device,
"This 8021x network has not been provisioned on this machine"); "This 8021x network has not been provisioned on this machine");
return FALSE; return FALSE;
} }
}
perm_hw_addr = nm_device_get_permanent_hw_address (device); perm_hw_addr = nm_device_get_permanent_hw_address (device);
if (perm_hw_addr) { 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 /* 8021x networks can only be used if they've been provisioned on the IWD side and
* thus are Known Networks. * 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)) if (!is_connection_known_network (connection))
return FALSE; return FALSE;
}
ap = nm_wifi_aps_find_first_compatible (priv->aps, connection, FALSE); ap = nm_wifi_aps_find_first_compatible (priv->aps, connection, FALSE);
if (ap) { if (ap) {