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:
Xiang Xiao
2020-01-02 10:49:34 -06:00
committed by Gregory Nutt
parent 316675f4db
commit 6a3c2aded6
1602 changed files with 6311 additions and 10874 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ int exec(FAR const char *filename, FAR char * const *argv,
errout_with_lock:
sched_unlock();
(void)unload_module(bin);
unload_module(bin);
errout_with_argv:
binfmt_freeargv(bin);
errout_with_bin:
+1 -1
View File
@@ -296,7 +296,7 @@ errout_with_tcbinit:
errout_with_addrenv:
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
(void)up_addrenv_restore(&oldenv);
up_addrenv_restore(&oldenv);
errout_with_tcb:
#endif
+1 -1
View File
@@ -188,7 +188,7 @@ int builtin_initialize(void)
void builtin_uninitialize(void)
{
(void)unregister_binfmt(&g_builtin_binfmt);
unregister_binfmt(&g_builtin_binfmt);
}
#endif /* HAVE_BUILTIN_CONTEXT */
+1 -1
View File
@@ -354,7 +354,7 @@ int elf_initialize(void)
void elf_uninitialize(void)
{
(void)unregister_binfmt(&g_elfbinfmt);
unregister_binfmt(&g_elfbinfmt);
}
#endif /* CONFIG_ELF */
+1 -1
View File
@@ -432,7 +432,7 @@ int elf_bind(FAR struct elf_loadinfo_s *loadinfo,
*/
#if 0 /* REVISIT... has some problems */
(void)up_addrenv_coherent(&loadinfo->addrenv);
up_addrenv_coherent(&loadinfo->addrenv);
#else
up_coherent_dcache(loadinfo->textalloc, loadinfo->textsize);
up_coherent_dcache(loadinfo->dataalloc, loadinfo->datasize);
+1 -1
View File
@@ -368,7 +368,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo)
errout_with_addrenv:
#ifdef CONFIG_ARCH_ADDRENV
(void)elf_addrenv_restore(loadinfo);
elf_addrenv_restore(loadinfo);
#endif
errout_with_buffers:
+1 -1
View File
@@ -169,7 +169,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize)
return OK;
errout_with_addrenv:
(void)up_addrenv_destroy(&loadinfo->addrenv);
up_addrenv_destroy(&loadinfo->addrenv);
loadinfo->addrenv = 0;
errout_with_dspace:
+1 -1
View File
@@ -475,7 +475,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo,
{
berr("Exported symbol \"%s\" not found\n", symname);
#ifdef CONFIG_ARCH_ADDRENV
(void)nxflat_addrenv_restore(loadinfo);
nxflat_addrenv_restore(loadinfo);
#endif
return -ENOENT;
}
+2 -2
View File
@@ -215,9 +215,9 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo)
errout:
#ifdef CONFIG_ARCH_ADDRENV
(void)nxflat_addrenv_restore(loadinfo);
nxflat_addrenv_restore(loadinfo);
#endif
(void)nxflat_unload(loadinfo);
nxflat_unload(loadinfo);
return ret;
}
+1 -1
View File
@@ -315,7 +315,7 @@ int nxflat_initialize(void)
void nxflat_uninitialize(void)
{
(void)unregister_binfmt(&g_nxflatbinfmt);
unregister_binfmt(&g_nxflatbinfmt);
}
#endif /* CONFIG_NXFLAT */