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:
parent
3d498dd10c
commit
732424f065
22 changed files with 23 additions and 47 deletions
|
@ -139,8 +139,7 @@ static const struct rtc_driver_api api = {
|
|||
static int rtc_qmsi_init(struct device *dev)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RTC_QMSI_API_REENTRANCY)) {
|
||||
k_sem_init(RP_GET(dev), 0, UINT_MAX);
|
||||
k_sem_give(RP_GET(dev));
|
||||
k_sem_init(RP_GET(dev), 1, UINT_MAX);
|
||||
}
|
||||
|
||||
IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_RTC_0_INT), CONFIG_RTC_0_IRQ_PRI,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue