mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling 1. Add semaphore uninterruptible wait function 2 .Replace semaphore wait loop with a single uninterruptible wait 3. Replace all sem_xxx to nxsem_xxx * Unify the void cast usage 1. Remove void cast for function because many place ignore the returned value witout cast 2. Replace void cast for variable with UNUSED macro
This commit is contained in:
@@ -919,7 +919,7 @@ static void usbmsc_lununinitialize(struct usbmsc_lun_s *lun)
|
||||
{
|
||||
/* Close the block driver */
|
||||
|
||||
(void)close_blockdriver(lun->inode);
|
||||
close_blockdriver(lun->inode);
|
||||
}
|
||||
|
||||
memset(lun, 0, sizeof(struct usbmsc_lun_s));
|
||||
@@ -1292,14 +1292,7 @@ void usbmsc_deferredresponse(FAR struct usbmsc_dev_s *priv, bool failed)
|
||||
|
||||
static inline void usbmsc_sync_wait(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
do
|
||||
{
|
||||
ret = nxsem_wait(&priv->thsynch);
|
||||
DEBUGASSERT(ret == OK || ret == -EINTR);
|
||||
}
|
||||
while (ret == -EINTR);
|
||||
nxsem_wait_uninterruptible(&priv->thsynch);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user