drivers, net: Clean up semaphore initialization

Change the common "init with 0" + "give" idiom to "init with 1".  This
won't change the behavior or performance, but should decrease the size
ever so slightly.

This change has been performed mechanically with the following
Coccinelle script:

    @@
    expression SEM;
    expression LIMIT;
    expression TIMEOUT;
    @@

    - k_sem_init(SEM, 0, LIMIT);
    - k_sem_give(SEM);
    + k_sem_init(SEM, 1, LIMIT);

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2017-07-27 10:59:06 -07:00 committed by Anas Nashif
commit 732424f065
22 changed files with 23 additions and 47 deletions

View file

@ -265,8 +265,7 @@ static int fxas21002_init(struct device *dev)
k_busy_wait(transition_time);
k_sem_init(&data->sem, 0, UINT_MAX);
k_sem_give(&data->sem);
k_sem_init(&data->sem, 1, UINT_MAX);
SYS_LOG_DBG("Init complete");