sched: Remove the unnecessary (FAR sem_t *) cast
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
8f7a16889e
commit
3f12b4f1e3
@ -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;
|
||||
|
@ -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).
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user