diff --git a/fs/semaphore/sem_unlink.c b/fs/semaphore/sem_unlink.c index 1d1314136d..1b7ad68a7d 100644 --- a/fs/semaphore/sem_unlink.c +++ b/fs/semaphore/sem_unlink.c @@ -141,7 +141,7 @@ int sem_unlink(FAR const char *name) */ inode_unlock(); - ret = sem_close((FAR sem_t *)inode->u.i_nsem); + ret = sem_close(&inode->u.i_nsem->ns_sem); RELEASE_SEARCH(&desc); sched_unlock(); return ret; diff --git a/sched/pthread/pthread_condbroadcast.c b/sched/pthread/pthread_condbroadcast.c index 607d6757d2..c85ec8da25 100644 --- a/sched/pthread/pthread_condbroadcast.c +++ b/sched/pthread/pthread_condbroadcast.c @@ -73,7 +73,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) /* Get the current value of the semaphore */ - if (nxsem_get_value((FAR sem_t *)&cond->sem, &sval) != OK) + if (nxsem_get_value(&cond->sem, &sval) != OK) { ret = EINVAL; } @@ -88,7 +88,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) * Only the highest priority waiting thread will get to execute */ - ret = pthread_sem_give((FAR sem_t *)&cond->sem); + ret = pthread_sem_give(&cond->sem); /* Increment the semaphore count (as was done by the * above post). diff --git a/sched/pthread/pthread_condsignal.c b/sched/pthread/pthread_condsignal.c index ba71ff2be9..13044de93e 100644 --- a/sched/pthread/pthread_condsignal.c +++ b/sched/pthread/pthread_condsignal.c @@ -65,7 +65,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) { /* Get the current value of the semaphore */ - if (nxsem_get_value((FAR sem_t *)&cond->sem, &sval) != OK) + if (nxsem_get_value(&cond->sem, &sval) != OK) { ret = EINVAL; } @@ -91,7 +91,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) if (sval < 0) { sinfo("Signalling...\n"); - ret = pthread_sem_give((FAR sem_t *)&cond->sem); + ret = pthread_sem_give(&cond->sem); } } } diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index c4da0805ba..b70a44c64c 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -107,7 +107,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) * or if the thread is canceled (ECANCELED) */ - status = pthread_sem_take((FAR sem_t *)&cond->sem, NULL, false); + status = pthread_sem_take(&cond->sem, NULL, false); if (ret == OK) { /* Report the first failure that occurs */ diff --git a/sched/pthread/pthread_mutexconsistent.c b/sched/pthread/pthread_mutexconsistent.c index 4cba0a0771..c9c888a8e4 100644 --- a/sched/pthread/pthread_mutexconsistent.c +++ b/sched/pthread/pthread_mutexconsistent.c @@ -114,7 +114,7 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex) * dead task had called pthread_mutex_unlock(). */ - status = nxsem_reset((FAR sem_t *)&mutex->sem, 1); + status = nxsem_reset(&mutex->sem, 1); if (status < 0) { ret = -status; diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c index 2a144dae8a..b3d088e815 100644 --- a/sched/pthread/pthread_mutexdestroy.c +++ b/sched/pthread/pthread_mutexdestroy.c @@ -101,7 +101,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) * destruction of the semaphore impossible here. */ - status = nxsem_reset((FAR sem_t *)&mutex->sem, 1); + status = nxsem_reset(&mutex->sem, 1); if (status < 0) { ret = -status; @@ -122,7 +122,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) else { - status = nxsem_destroy((FAR sem_t *)&mutex->sem); + status = nxsem_destroy(&mutex->sem); ret = (status < 0) ? -status : OK; } } @@ -139,7 +139,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) * Perhaps this logic should all nxsem_reset() first? */ - status = nxsem_destroy((FAR sem_t *)&mutex->sem); + status = nxsem_destroy(&mutex->sem); ret = ((status < 0) ? -status : OK); } diff --git a/sched/pthread/pthread_mutexinit.c b/sched/pthread/pthread_mutexinit.c index 0e4b5f1008..b2e976e819 100644 --- a/sched/pthread/pthread_mutexinit.c +++ b/sched/pthread/pthread_mutexinit.c @@ -107,7 +107,7 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, /* Initialize the mutex like a semaphore with initial count = 1 */ - status = nxsem_init((FAR sem_t *)&mutex->sem, pshared, 1); + status = nxsem_init(&mutex->sem, pshared, 1); if (status < 0) { ret = -ret; @@ -116,7 +116,7 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, #ifdef CONFIG_PRIORITY_INHERITANCE /* Initialize the semaphore protocol */ - status = nxsem_set_protocol((FAR sem_t *)&mutex->sem, proto); + status = nxsem_set_protocol(&mutex->sem, proto); if (status < 0) { ret = -status;