binfmt: nxstyle fixes

small nxstyle fixes for binfmt to avoid CI warnings

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2020-04-22 10:24:15 +02:00 committed by patacongo
parent 02ab0cd149
commit 7ddf7c6c25
10 changed files with 40 additions and 26 deletions

View File

@ -61,9 +61,10 @@ extern "C"
#define EXTERN extern
#endif
/* This is a list of registered handlers for different binary formats. This
* list should only be accessed by normal user programs. It should be sufficient
* protection to simply disable pre-emption when accessing this list.
/* This is a list of registered handlers for different binary formats.
* This list should only be accessed by normal user programs. It should be
* sufficient protection to simply disable pre-emption when accessing this
* list.
*/
EXTERN FAR struct binfmt_s *g_binfmts;

View File

@ -103,19 +103,23 @@ int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *argv)
for (i = 0; argv[i]; i++)
{
/* Increment the size of the allocation with the size of the next string */
/* Increment the size of the allocation with the size of the next
* string
*/
argsize += (strlen(argv[i]) + 1);
nargs++;
/* This is a sanity check to prevent running away with an unterminated
* argv[] list. MAX_EXEC_ARGS should be sufficiently large that this
/* This is a sanity check to prevent running away with an
* unterminated argv[] list.
* MAX_EXEC_ARGS should be sufficiently large that this
* never happens in normal usage.
*/
if (nargs > MAX_EXEC_ARGS)
{
berr("ERROR: Too many arguments: %lu\n", (unsigned long)argvsize);
berr("ERROR: Too many arguments: %lu\n",
(unsigned long)argvsize);
return -E2BIG;
}
}

View File

@ -75,7 +75,9 @@ int dump_module(FAR const struct binary_s *bin)
binfo(" argv: %p\n", bin->argv);
binfo(" entrypt: %p\n", bin->entrypt);
binfo(" mapped: %p size=%d\n", bin->mapped, bin->mapsize);
binfo(" alloc: %p %p %p\n", bin->alloc[0], bin->alloc[1], bin->alloc[2]);
binfo(" alloc: %p %p %p\n", bin->alloc[0],
bin->alloc[1],
bin->alloc[2]);
#ifdef CONFIG_BINFMT_CONSTRUCTORS
binfo(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors);
binfo(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors);

View File

@ -97,7 +97,8 @@ static int g_exec_nsymbols;
*
* Input Parameters:
* symtab - The location to store the symbol table.
* nsymbols - The location to store the number of symbols in the symbol table.
* nsymbols - The location to store the number of symbols in the symbol
* table.
*
* Returned Value:
* None

View File

@ -51,9 +51,10 @@
* Public Data
****************************************************************************/
/* This is a list of registered handlers for different binary formats. This
* list should only be accessed by normal user programs. It should be sufficient
* protection to simply disable pre-emption when accessing this list.
/* This is a list of registered handlers for different binary formats.
* This list should only be accessed by normal user programs. It should be
* sufficient protection to simply disable pre-emption when accessing this
* list.
*/
FAR struct binfmt_s *g_binfmts;

View File

@ -57,8 +57,8 @@
* Pre-processor Definitions
****************************************************************************/
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
* defined or CONFIG_ELF_DUMPBUFFER does nothing.
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
* have to be defined or CONFIG_ELF_DUMPBUFFER does nothing.
*/
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)

View File

@ -169,8 +169,8 @@ int elf_readsym(FAR struct elf_loadinfo_s *loadinfo, int index,
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
* EINVAL - There is something inconsistent in the symbol table (should only
* happen if the file is corrupted)
* EINVAL - There is something inconsistent in the symbol table (should
* only happen if the file is corrupted)
* ENOSYS - Symbol lies in common
* ESRCH - Symbol has no name
* ENOENT - Symbol undefined and not provided via a symbol table
@ -265,12 +265,13 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo);
* Name: elf_addrenv_alloc
*
* Description:
* Allocate memory for the ELF image (textalloc and dataalloc). If
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
* textalloc and dataalloc will be allocated using up_addrenv_create(). In
* either case, there will be a unique instance of textalloc and dataalloc
* (and stack) for each instance of a process.
* Allocate memory for the ELF image (textalloc and dataalloc).
* If CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc()
* and dataalloc will be a offset from textalloc.
* If CONFIG_ARCH_ADDRENV-y, then textalloc and dataalloc will be allocated
* using up_addrenv_create().
* In either case, there will be a unique instance of textalloc and
* dataalloc (and stack) for each instance of a process.
*
* Input Parameters:
* loadinfo - Load state information

View File

@ -254,7 +254,9 @@ int elf_findsection(FAR struct elf_loadinfo_s *loadinfo,
int ret;
int i;
/* Search through the shdr[] array in loadinfo for a section named 'sectname' */
/* Search through the shdr[] array in loadinfo for a section named
* 'sectname'
*/
for (i = 0; i < loadinfo->ehdr.e_shnum; i++)
{

View File

@ -319,7 +319,9 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
return -ENOENT;
}
/* Yes... add the exported symbol value to the ELF symbol table entry */
/* Yes... add the exported symbol value to the ELF symbol table
* entry
*/
binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
loadinfo->iobuffer, sym->st_value, symbol->sym_value,

View File

@ -58,8 +58,8 @@
* Pre-processor Definitions
****************************************************************************/
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
* defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
* have to be defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
*/
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)