diff options
Diffstat (limited to 'kern/turnstile.c')
-rw-r--r-- | kern/turnstile.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/kern/turnstile.c b/kern/turnstile.c index e59a7f3f..a9b994d5 100644 --- a/kern/turnstile.c +++ b/kern/turnstile.c @@ -401,14 +401,14 @@ turnstile_td_propagate_priority(struct turnstile_td *td) turnstile_td_propagate_priority_loop(td); } -static void -turnstile_assert_init_state(const struct turnstile *turnstile) +__unused static bool +turnstile_state_initialized(const struct turnstile *turnstile) { - assert(turnstile->bucket == NULL); - assert(turnstile->sync_obj == NULL); - assert(plist_empty(&turnstile->waiters)); - assert(turnstile->next_free == NULL); - assert(turnstile->top_waiter == NULL); + return ((turnstile->bucket == NULL) + && (turnstile->sync_obj == NULL) + && (plist_empty(&turnstile->waiters)) + && (turnstile->next_free == NULL) + && (turnstile->top_waiter == NULL)); } static void @@ -425,7 +425,7 @@ turnstile_unuse(struct turnstile *turnstile) turnstile->sync_obj = NULL; } -static bool +__unused static bool turnstile_in_use(const struct turnstile *turnstile) { return turnstile->sync_obj != NULL; @@ -464,7 +464,7 @@ turnstile_bucket_add(struct turnstile_bucket *bucket, } static void -turnstile_bucket_remove(struct turnstile_bucket *bucket, +turnstile_bucket_remove(__unused struct turnstile_bucket *bucket, struct turnstile *turnstile) { assert(turnstile->bucket == bucket); @@ -529,14 +529,14 @@ turnstile_create(void) return NULL; } - turnstile_assert_init_state(turnstile); + assert(turnstile_state_initialized(turnstile)); return turnstile; } void turnstile_destroy(struct turnstile *turnstile) { - turnstile_assert_init_state(turnstile); + assert(turnstile_state_initialized(turnstile)); kmem_cache_free(&turnstile_cache, turnstile); } @@ -603,7 +603,7 @@ turnstile_lend(const void *sync_obj) assert(sync_obj != NULL); turnstile = thread_turnstile_lend(); - turnstile_assert_init_state(turnstile); + assert(turnstile_state_initialized(turnstile)); td = thread_turnstile_td(thread_self()); bucket = turnstile_bucket_get(sync_obj); @@ -653,7 +653,7 @@ turnstile_return(struct turnstile *turnstile) spinlock_unlock(&bucket->lock); - turnstile_assert_init_state(free_turnstile); + assert(turnstile_state_initialized(free_turnstile)); thread_turnstile_return(free_turnstile); } @@ -774,7 +774,7 @@ void turnstile_wait(struct turnstile *turnstile, const char *wchan, struct thread *owner) { - int error; + __unused int error; error = turnstile_wait_common(turnstile, wchan, owner, false, 0); assert(!error); @@ -806,7 +806,7 @@ turnstile_own(struct turnstile *turnstile) { struct turnstile_td *td; struct thread *owner; - unsigned int top_priority; + __unused unsigned int top_priority; assert(turnstile->owner == NULL); |