Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ieee80211/src/ieee80211_iface_impl.c

    r3061bc1 ra35b458  
    5555        nic_t *nic_data = nic_get_from_ddf_fun(fun);
    5656        ieee80211_dev_t *ieee80211_dev = nic_get_specific(nic_data);
    57        
     57
    5858        if (!ieee80211_is_ready(ieee80211_dev))
    5959                return EREFUSED;
    60        
     60
    6161        if (now)
    6262                ieee80211_dev->ops->scan(ieee80211_dev);
    63        
     63
    6464        fibril_mutex_lock(&ieee80211_dev->ap_list.results_mutex);
    65        
     65
    6666        if (results) {
    6767                ieee80211_scan_result_list_t *result_list =
    6868                    &ieee80211_dev->ap_list;
    69                
     69
    7070                unsigned int i = 0;
    7171                ieee80211_scan_result_list_foreach(*result_list, result) {
     
    7575                        i++;
    7676                }
    77                
     77
    7878                results->length = i;
    7979        }
    80        
     80
    8181        fibril_mutex_unlock(&ieee80211_dev->ap_list.results_mutex);
    82        
     82
    8383        return EOK;
    8484}
     
    102102{
    103103        ieee80211_dev->bssid_info.res_link = auth_data;
    104        
     104
    105105        /* Set channel. */
    106106        errno_t rc = ieee80211_dev->ops->set_freq(ieee80211_dev,
     
    108108        if (rc != EOK)
    109109                return rc;
    110        
     110
    111111        /* Try to authenticate. */
    112112        ieee80211_authenticate(ieee80211_dev);
    113        
     113
    114114        fibril_mutex_lock(&ieee80211_dev->gen_mutex);
    115115        rc = fibril_condvar_wait_timeout(&ieee80211_dev->gen_cond,
    116116            &ieee80211_dev->gen_mutex, AUTH_TIMEOUT);
    117117        fibril_mutex_unlock(&ieee80211_dev->gen_mutex);
    118        
     118
    119119        if (rc != EOK)
    120120                return rc;
    121        
     121
    122122        if (ieee80211_get_auth_phase(ieee80211_dev) !=
    123123            IEEE80211_AUTH_AUTHENTICATED) {
     
    126126                return EINVAL;
    127127        }
    128        
     128
    129129        /* Try to associate. */
    130130        ieee80211_associate(ieee80211_dev, password);
    131        
     131
    132132        fibril_mutex_lock(&ieee80211_dev->gen_mutex);
    133133        rc = fibril_condvar_wait_timeout(&ieee80211_dev->gen_cond,
    134134            &ieee80211_dev->gen_mutex, AUTH_TIMEOUT);
    135135        fibril_mutex_unlock(&ieee80211_dev->gen_mutex);
    136        
     136
    137137        if (rc != EOK)
    138138                return rc;
    139        
     139
    140140        if (ieee80211_get_auth_phase(ieee80211_dev) !=
    141141            IEEE80211_AUTH_ASSOCIATED) {
     
    144144                return EINVAL;
    145145        }
    146        
     146
    147147        /* On open network, we are finished. */
    148148        if (auth_data->scan_result.security.type !=
    149149            IEEE80211_SECURITY_OPEN) {
    150150                /* Otherwise wait for 4-way handshake to complete. */
    151                
     151
    152152                fibril_mutex_lock(&ieee80211_dev->gen_mutex);
    153153                rc = fibril_condvar_wait_timeout(&ieee80211_dev->gen_cond,
    154154                    &ieee80211_dev->gen_mutex, HANDSHAKE_TIMEOUT);
    155155                fibril_mutex_unlock(&ieee80211_dev->gen_mutex);
    156                
     156
    157157                if (rc != EOK) {
    158158                        ieee80211_deauthenticate(ieee80211_dev);
     
    160160                }
    161161        }
    162        
     162
    163163        ieee80211_set_auth_phase(ieee80211_dev, IEEE80211_AUTH_CONNECTED);
    164        
     164
    165165        return EOK;
    166166}
     
    182182        assert(ssid_start);
    183183        assert(password);
    184        
     184
    185185        nic_t *nic_data = nic_get_from_ddf_fun(fun);
    186186        ieee80211_dev_t *ieee80211_dev = nic_get_specific(nic_data);
    187        
     187
    188188        if (!ieee80211_is_ready(ieee80211_dev))
    189189                return EREFUSED;
    190        
     190
    191191        if (ieee80211_is_connected(ieee80211_dev)) {
    192192                errno_t rc = ieee80211_dev->iface->disconnect(fun);
     
    194194                        return rc;
    195195        }
    196        
     196
    197197        ieee80211_set_connect_request(ieee80211_dev);
    198        
     198
    199199        errno_t rc = ENOENT;
    200200        fibril_mutex_lock(&ieee80211_dev->scan_mutex);
    201        
     201
    202202        ieee80211_dev->pending_conn_req = false;
    203        
     203
    204204        ieee80211_scan_result_list_foreach(ieee80211_dev->ap_list, result) {
    205205                if (!str_lcmp(ssid_start, result->scan_result.ssid,
     
    210210                }
    211211        }
    212        
     212
    213213        fibril_mutex_unlock(&ieee80211_dev->scan_mutex);
    214        
     214
    215215        return rc;
    216216}
     
    228228        nic_t *nic_data = nic_get_from_ddf_fun(fun);
    229229        ieee80211_dev_t *ieee80211_dev = nic_get_specific(nic_data);
    230        
     230
    231231        if (!ieee80211_is_ready(ieee80211_dev))
    232232                return EREFUSED;
    233        
     233
    234234        if (!ieee80211_is_connected(ieee80211_dev))
    235235                return EOK;
    236        
     236
    237237        fibril_mutex_lock(&ieee80211_dev->ap_list.results_mutex);
    238238        errno_t rc = ieee80211_deauthenticate(ieee80211_dev);
    239239        fibril_mutex_unlock(&ieee80211_dev->ap_list.results_mutex);
    240        
     240
    241241        return rc;
    242242}
Note: See TracChangeset for help on using the changeset viewer.