diff --git a/os/audio/audio.c b/os/audio/audio.c index af4c43e450..5285b55dad 100644 --- a/os/audio/audio.c +++ b/os/audio/audio.c @@ -73,6 +73,7 @@ #include #include #include +#include #include @@ -938,7 +939,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s)); if (!upper) { - auddbg("ERROR: Allocation failed\n"); + auddbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -990,7 +991,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) ret = mkdir(path, 0644); if (ret < 0) { - auddbg("ERROR: mkdir failed\n"); + auddbg("%s %s \n", clog_message_str[CMN_LOG_FAILED_OP], path); kmm_free(upper); return ret; } @@ -1031,7 +1032,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) ret = mkdir(devname, 0644); if (ret < 0) { - auddbg("ERROR: mkdir failed\n"); + auddbg("%s: mkdir %s \n", clog_message_str[CMN_LOG_FAILED_OP], devname); kmm_free(upper); return ret; } diff --git a/os/binfmt/binfmt_exec.c b/os/binfmt/binfmt_exec.c index 254807d7b0..073e8a9d37 100644 --- a/os/binfmt/binfmt_exec.c +++ b/os/binfmt/binfmt_exec.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "binfmt.h" @@ -149,7 +150,7 @@ int exec(FAR const char *filename, FAR char *const *argv, FAR const struct symta start_addr = kmm_memalign(size, size); if (!start_addr) { - berr("ERROR: Failed to allocate RAM partition\n"); + berr("%s RAM Partition\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); errcode = ENOMEM; goto errout; } @@ -159,7 +160,7 @@ int exec(FAR const char *filename, FAR char *const *argv, FAR const struct symta bin = (FAR struct binary_s *)kmm_zalloc(sizeof(struct binary_s)); if (!bin) { - berr("ERROR: Failed to allocate binary_s\n"); + berr(" %s binary_s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); errcode = ENOMEM; goto err_free_partition; } @@ -178,7 +179,7 @@ int exec(FAR const char *filename, FAR char *const *argv, FAR const struct symta ret = binfmt_copyargv(bin, argv); if (ret < 0) { errcode = -ret; - berr("ERROR: Failed to copy argv[]: %d\n", errcode); + berr("%s to copy argv[]: %d\n" ,clog_message_str[CMN_LOG_FAILED_OP], errcode); goto errout_with_bin; } @@ -187,7 +188,7 @@ int exec(FAR const char *filename, FAR char *const *argv, FAR const struct symta ret = load_module(bin); if (ret < 0) { errcode = -ret; - berr("ERROR: Failed to load program '%s': %d\n", filename, errcode); + berr("%s to load program %s': %d\n",clog_message_str[CMN_LOG_FAILED_OP], filename, errcode); goto errout_with_argv; } @@ -203,7 +204,7 @@ int exec(FAR const char *filename, FAR char *const *argv, FAR const struct symta pid = exec_module(bin); if (pid < 0) { errcode = -pid; - berr("ERROR: Failed to execute program '%s': %d\n", filename, errcode); + berr("%s to execute program'%s': %d\n",clog_message_str[CMN_LOG_FAILED_OP], filename, errcode); goto errout_with_lock; } diff --git a/os/binfmt/binfmt_execmodule.c b/os/binfmt/binfmt_execmodule.c index 274abd68e2..41b8aa0e13 100644 --- a/os/binfmt/binfmt_execmodule.c +++ b/os/binfmt/binfmt_execmodule.c @@ -68,6 +68,8 @@ #include #include #include +#include + #if defined(CONFIG_APP_BINARY_SEPARATION) && defined(CONFIG_ARCH_USE_MMU) #include #endif @@ -188,7 +190,7 @@ int exec_module(FAR struct binary_s *binp) binp->uheap = (struct mm_heap_s *)binp->sections[BIN_HEAP]; ret = mm_initialize(binp->uheap, (void *)binp->sections[BIN_HEAP] + sizeof(struct mm_heap_s), binp->sizes[BIN_HEAP]); if (ret != OK) { - berr("ERROR: mm_initialize() failed, %d.\n", ret); + berr("%s of mm_initialize(): %d.\n",clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } mm_add_app_heap_list(binp->uheap, binp->bin_name); @@ -213,7 +215,7 @@ int exec_module(FAR struct binary_s *binp) ret = up_create_stack((FAR struct tcb_s *)newtcb, binp->stacksize, TCB_FLAG_TTYPE_TASK); if (ret < 0) { - berr("ERROR: up_create_stack() failed.\n"); + berr("%s: up_create_stack()\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_appheap; } stack = newtcb->cmn.stack_alloc_ptr; @@ -223,7 +225,7 @@ int exec_module(FAR struct binary_s *binp) ret = task_init((FAR struct tcb_s *)newtcb, binp->filename, binp->priority, NULL, binp->stacksize, binp->entrypt, binp->argv); if (ret < 0) { ret = -get_errno(); - berr("task_init() failed: %d\n", ret); + berr("%s of task_init: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_stack; } @@ -261,7 +263,7 @@ int exec_module(FAR struct binary_s *binp) ret = shm_group_initialize(newtcb->cmn.group); if (ret < 0) { - berr("ERROR: shm_group_initialize() failed: %d\n", ret); + berr("%s of shm_group_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_tcbinit; } #endif @@ -343,7 +345,7 @@ int exec_module(FAR struct binary_s *binp) ret = task_activate((FAR struct tcb_s *)newtcb); if (ret < 0) { ret = -get_errno(); - berr("task_activate() failed: %d\n", ret); + berr("%s of task_activate(): %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_tcbinit; } diff --git a/os/binfmt/binfmt_exit.c b/os/binfmt/binfmt_exit.c index 03bbc5c447..261a0f32a7 100644 --- a/os/binfmt/binfmt_exit.c +++ b/os/binfmt/binfmt_exit.c @@ -67,6 +67,7 @@ #include #include #include +#include #include "binfmt.h" @@ -110,7 +111,7 @@ int binfmt_exit(FAR struct binary_s *bin) ret = unload_module(bin); if (ret < 0) { - berr("ERROR: unload_module() failed: %d\n", ret); + berr("%s %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } elf_delete_bin_section_addr(bin->binary_idx); diff --git a/os/binfmt/binfmt_initialize.c b/os/binfmt/binfmt_initialize.c index 3adc55733d..658ae313a0 100644 --- a/os/binfmt/binfmt_initialize.c +++ b/os/binfmt/binfmt_initialize.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifdef CONFIG_BINFMT_ENABLE @@ -81,35 +82,35 @@ void binfmt_initialize(void) #ifdef CONFIG_FS_BINFS ret = builtin_initialize(); if (ret < 0) { - berr("ERROR: builtin_initialize failed: %d\n", ret); + berr("%s of builtin_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } #endif #ifdef CONFIG_ELF ret = elf_initialize(); if (ret < 0) { - berr("ERROR: elf_initialize failed: %d\n", ret); + berr("%s of elf_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } #endif #ifdef CONFIG_BINFMT_PCODE ret = pcode_initialize(); if (ret < 0) { - berr("ERROR: pcode_initialize failed: %d\n", ret); + berr("%s of pcode_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } #endif #ifdef CONFIG_NXFLAT ret = nxflat_initialize(); if (ret < 0) { - berr("ERROR: nxflat_initialize failed: %d\n", ret); + berr("%s of nxflat_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } #endif #ifdef CONFIG_XIP_ELF ret = xipelf_initialize(); if (ret < 0) { - berr("ERROR: xipelf_initialize failed: %d\n", ret); + berr("%s of xipelf_initialize(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } #endif diff --git a/os/binfmt/binfmt_loadbinary.c b/os/binfmt/binfmt_loadbinary.c index 32b0bc9c28..2613ce5520 100644 --- a/os/binfmt/binfmt_loadbinary.c +++ b/os/binfmt/binfmt_loadbinary.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef CONFIG_SAVE_BIN_SECTION_ADDR #include "libelf/libelf.h" @@ -89,11 +90,11 @@ int load_binary(int binary_idx, FAR const char *filename, load_attr_t *load_attr /* Sanity check */ if (!load_attr) { - berr("ERROR: Invalid load_attr\n"); + berr("%s attr\n", clog_message_str[CMN_LOG_INVALID_VAL]); errcode = -EINVAL; goto errout; } else if (load_attr->bin_size <= 0) { - berr("ERROR: Invalid file length!\n"); + berr("%s file length \n", clog_message_str[CMN_LOG_INVALID_VAL]); errcode = -EINVAL; goto errout; } @@ -107,7 +108,7 @@ int load_binary(int binary_idx, FAR const char *filename, load_attr_t *load_attr if (bin) { if (!bin->data_backup) { errcode = -EINVAL; - berr("ERROR: Failed to find copy of data section from previous load\n"); + berr("%s copy of data section not same as previous load\n",clog_message_str[CMN_LOG_INVALID_DATA]); goto errout_with_bin; } @@ -121,7 +122,7 @@ int load_binary(int binary_idx, FAR const char *filename, load_attr_t *load_attr bin = (FAR struct binary_s *)kmm_zalloc(sizeof(struct binary_s)); if (!bin) { - berr("ERROR: Failed to allocate binary_s\n"); + berr("%s binary_s\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); errcode = -ENOMEM; goto errout_with_bin; } @@ -165,7 +166,7 @@ int load_binary(int binary_idx, FAR const char *filename, load_attr_t *load_attr ret = load_module(bin); if (ret < 0) { errcode = ret; - berr("ERROR: Failed to load program '%s': %d\n", filename, errcode); + berr("%s load program '%s': %d\n",clog_message_str[CMN_LOG_FAILED_OP], filename, errcode); goto errout_with_bin; } @@ -215,7 +216,7 @@ int load_binary(int binary_idx, FAR const char *filename, load_attr_t *load_attr pid = exec_module(bin); if (pid < 0) { errcode = pid; - berr("ERROR: Failed to execute program '%s': %d\n", filename, errcode); + berr("%s to execute program '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP], filename, errcode); elf_delete_bin_section_addr(bin->binary_idx); goto errout_with_unload; } diff --git a/os/binfmt/binfmt_loadmodule.c b/os/binfmt/binfmt_loadmodule.c index 43dafd64ad..f6d7199da1 100644 --- a/os/binfmt/binfmt_loadmodule.c +++ b/os/binfmt/binfmt_loadmodule.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "binfmt.h" @@ -97,7 +98,7 @@ static int load_default_priority(FAR struct binary_s *bin) ret = sched_getparam(0, ¶m); if (ret < 0) { - berr("ERROR: sched_getparam failed: %d\n", ret); + berr("%s %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } diff --git a/os/binfmt/binfmt_unloadmodule.c b/os/binfmt/binfmt_unloadmodule.c index 0e6856274b..3b446df9b0 100644 --- a/os/binfmt/binfmt_unloadmodule.c +++ b/os/binfmt/binfmt_unloadmodule.c @@ -64,6 +64,7 @@ #include #include +#include #include "binfmt.h" #include "binfmt_arch_apis.h" @@ -143,7 +144,7 @@ int unload_module(FAR struct binary_s *binp) if (binp->unload) { ret = binp->unload(binp); if (ret < 0) { - berr("binp->unload() failed: %d\n", ret); + berr("%s of binp->unload(): %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } } @@ -152,7 +153,7 @@ int unload_module(FAR struct binary_s *binp) ret = exec_dtors(binp); if (ret < 0) { - berr("exec_ctors() failed: %d\n", ret); + berr("%s of exec_ctors(): %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } #endif diff --git a/os/binfmt/builtin.c b/os/binfmt/builtin.c index b61c3e2dca..4b5f6c2671 100644 --- a/os/binfmt/builtin.c +++ b/os/binfmt/builtin.c @@ -69,6 +69,7 @@ #include #include #include +#include #ifdef CONFIG_BUILTIN @@ -118,7 +119,7 @@ static int builtin_loadbinary(struct binary_s *binp) fd = open(binp->filename, O_RDONLY); if (fd < 0) { - berr("ERROR: Failed to open binary %s: %d\n", binp->filename, fd); + berr("%s %s: %d\n",clog_message_str[CMN_LOG_FILE_OPEN_ERROR], binp->filename, fd); return fd; } @@ -129,7 +130,7 @@ static int builtin_loadbinary(struct binary_s *binp) ret = ioctl(fd, FIOC_FILENAME, (unsigned long)((uintptr_t) & filename)); if (ret < 0) { int errval = get_errno(); - berr("ERROR: FIOC_FILENAME ioctl failed: %d\n", errval); + berr("%s %d\n",clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], errval); close(fd); return -errval; } @@ -187,7 +188,7 @@ int builtin_initialize(void) ret = register_binfmt(&g_builtin_binfmt); if (ret != 0) { - berr("Failed to register binfmt: %d\n", ret); + berr("%s : %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; diff --git a/os/binfmt/elf.c b/os/binfmt/elf.c index a48e15fb83..b53abc46cc 100644 --- a/os/binfmt/elf.c +++ b/os/binfmt/elf.c @@ -65,6 +65,7 @@ #include #include #include +#include #include "libelf/libelf.h" @@ -219,7 +220,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) ret = elf_init(binp->filename, &loadinfo); if (ret != 0) { elf_dumploadinfo(&loadinfo); - berr("Failed to initialize for load of ELF program: %d\n", ret); + berr("%s to initialize for load of ELF program: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout; } @@ -228,7 +229,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) ret = elf_load(&loadinfo); elf_dumploadinfo(&loadinfo); if (ret != 0) { - berr("Failed to load ELF program binary: %d\n", ret); + berr("%s: load ELF program %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_init; } @@ -236,7 +237,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) ret = elf_bind(&loadinfo, binp->exports, binp->nexports); if (ret != 0) { - berr("Failed to bind symbols program binary: %d\n", ret); + berr("%s: bind symbols %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_load; } @@ -301,7 +302,7 @@ int elf_initialize(void) ret = register_binfmt(&g_elfbinfmt); if (ret != 0) { - berr("Failed to register binfmt: %d\n", ret); + berr("%s: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; diff --git a/os/binfmt/libelf/libelf_addrenv.c b/os/binfmt/libelf/libelf_addrenv.c index 7ab6e3f80d..d60a162415 100644 --- a/os/binfmt/libelf/libelf_addrenv.c +++ b/os/binfmt/libelf/libelf_addrenv.c @@ -62,6 +62,7 @@ #include #include #include +#include #include "libelf.h" #include "binfmt_arch_apis.h" @@ -89,7 +90,7 @@ static int allocateregions(FAR struct elf_loadinfo_s *loadinfo) } } if (count != 1) { - lldbg("ERROR: Expected to have exactly one heap region for apps, but found %d regions\n", count); + lldbg("%s heap regions %d\n", clog_message_str[CMN_LOG_INVALID_VAL], count); ASSERT(0); } @@ -169,7 +170,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo) loadinfo->binp->ramsize = datamemsize; if (allocateregions(loadinfo) < 0) { - berr("ERROR: failed to allocate memory\n"); + berr("%s\n",clog_message_str[ CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -187,7 +188,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo) loadinfo->binp->ramstart = (uint32_t)binfmt_arch_allocate_section(loadinfo->binp->ramsize); if (!loadinfo->binp->ramstart) { - berr("ERROR: Failed to allocate RAM partition\n"); + berr("%s RAM partition \n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -203,18 +204,18 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo) memset(loadinfo->binp->sections[BIN_BSS], 0, loadinfo->binp->sizes[BIN_BSS]); if (!loadinfo->binp->sections[BIN_TEXT]) { - berr("ERROR: Failed to allocate text section (size = %u)\n", loadinfo->binp->sizes[BIN_TEXT]); + berr("%s text section (size = %u)\n",clog_message_str[CMN_LOG_ALLOC_FAIL], loadinfo->binp->sizes[BIN_TEXT]); return -ENOMEM; } if (!loadinfo->binp->sections[BIN_DATA]) { - berr("ERROR: Failed to allocate data section (size = %u)\n", loadinfo->binp->ramsize); + berr("%s data section (size = %u)\n",clog_message_str[CMN_LOG_ALLOC_FAIL], loadinfo->binp->ramsize); return -ENOMEM; } #ifdef CONFIG_OPTIMIZE_APP_RELOAD_TIME if (!loadinfo->binp->sections[BIN_RO]) { - berr("ERROR: Failed to allocate ro section (size = %u)\n", loadinfo->binp->sizes[BIN_RO]); + berr("%s ro section (size = %u)\n"clog_message_str[CMN_LOG_ALLOC_FAIL], loadinfo->binp->sizes[BIN_RO]); return -ENOMEM; } #endif diff --git a/os/binfmt/libelf/libelf_bind.c b/os/binfmt/libelf/libelf_bind.c index 59088b3cd4..c7300152a1 100644 --- a/os/binfmt/libelf/libelf_bind.c +++ b/os/binfmt/libelf/libelf_bind.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include "libelf.h" @@ -108,12 +109,12 @@ static inline void elf_readreltab(FAR struct elf_loadinfo_s *loadinfo, FAR const loadinfo->reltab = (uintptr_t)kmm_malloc(relsec->sh_size); if (!loadinfo->reltab) { - berr("ERROR: Failed to allocate space for relocation table. Size = %u\n", relsec->sh_size); + berr("%s relocation table. Size = %u\n",clog_message_str[CMN_LOG_ALLOC_FAIL], relsec->sh_size); return; } if (elf_read(loadinfo, (FAR uint8_t *)loadinfo->reltab, relsec->sh_size, relsec->sh_offset) < 0) { - berr("ERROR: Failed to read relocation table into memory\n"); + berr("%s to read relocation table\n"clog_message_str[CMN_LOG_FAILED_OP]); } } @@ -257,7 +258,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, FAR con ret = up_relocate(prel, psym, addr); if (ret < 0) { - berr("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); + berr("%s Section %d reloc %d: Relocation : %d\n",clog_message_str[CMN_LOG_FAILED_OP], relidx, i, ret); goto ret_err; } } @@ -305,7 +306,7 @@ static int export_library_symtab(FAR struct elf_loadinfo_s *loadinfo) } else { ret = elf_readsym(loadinfo, i, &sym); if (ret < 0) { - berr("Failed to read symbol[%d]: %d\n", i, ret); + berr("%s to read symbol[%d]: %d\n",clog_message_str[CMN_LOG_FAILED_OP], i, ret); goto ret_err; } } @@ -313,7 +314,7 @@ static int export_library_symtab(FAR struct elf_loadinfo_s *loadinfo) if (ELF32_ST_BIND(psym->st_info) == STB_GLOBAL || ELF32_ST_BIND(psym->st_info) == STB_WEAK) { ret = elf_symname(loadinfo, psym); if (ret < 0) { - berr("SHN_UNDEF: Failed to get symbol name: %d\n", ret); + berr("%s to get symbol name: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto ret_err; } @@ -324,7 +325,7 @@ static int export_library_symtab(FAR struct elf_loadinfo_s *loadinfo) if (ret == -ESRCH) { berr("Undefined symbol[%d] has no name: %d\n", i, ret); } else { - berr("Failed to get value of symbol[%d]: %d\n", i, ret); + berr("%s to get value of symbol[%d]: %d\n",clog_message_str[CMN_LOG_FAILED_OP], i, ret); } goto ret_err; } diff --git a/os/binfmt/libelf/libelf_cache.c b/os/binfmt/libelf/libelf_cache.c index 5d40c7d456..e4aca27562 100644 --- a/os/binfmt/libelf/libelf_cache.c +++ b/os/binfmt/libelf/libelf_cache.c @@ -29,6 +29,8 @@ #include #include +#include + #include "libelf.h" #ifdef CONFIG_COMPRESSED_BINARY @@ -110,7 +112,7 @@ static off_t elf_cache_lseek_block(int filfd, uint16_t binary_header_size, int b if (rpos != actual_offset) { int errval = get_errno(); - berr("Failed to seek to position %lu: %d\n", (unsigned long)actual_offset, errval); + berr("%s position %lu: %d\n",clog_message_str[CMN_LOG_FILE_SEEK_ERROR], (unsigned long)actual_offset, errval); return -errval; } @@ -145,7 +147,7 @@ static off_t elf_cache_read_block(int filfd, uint16_t binary_header_size, FAR ui if (rpos < 0) { - berr("Failed to seek to offset of block number %d\n", block_number); + berr("%s block number %d\n",clog_message_str[CMN_LOG_FILE_SEEK_ERROR], block_number); return rpos; } @@ -168,7 +170,7 @@ static off_t elf_cache_read_block(int filfd, uint16_t binary_header_size, FAR ui if (nbytes != readsize) { int errval = get_errno(); - berr("Read failed for size (%d) errno(%d)\n", readsize, errval); + berr("%s size (%d) errno(%d)\n", clog_message_str[CMN_LOG_FILE_READ_ERROR], readsize, errval); return -errval; } @@ -244,7 +246,7 @@ static unsigned int elf_cache_update_blockcache_list(int block_number, int filfd /* Read elf 'block_number' block into respective 'out_buffer' */ size = elf_cache_read_block(filfd, binary_header_size, ptr->out_buffer, block_number); if (size < 0) { - berr("Read for block %d failed\n", block_number); + berr("%s block %d\n",clog_message_str[CMN_LOG_FILE_READ_ERROR], block_number); return ERROR; } @@ -469,7 +471,7 @@ int elf_cache_init(int filfd, uint16_t offset, off_t filelen) blockcache = (block_cache_t *)kmm_malloc(number_blocks_caching * sizeof(block_cache_t)); if (!blockcache) { - berr("Failed kmm_malloc for blockcache\n"); + berr("%s blockcache \n",clog_message_str[CMN_LOG_ALLOC_FAIL]); elf_cache_uninit(); return -ENOMEM; } @@ -479,7 +481,7 @@ int elf_cache_init(int filfd, uint16_t offset, off_t filelen) blockcache[i].out_buffer = (unsigned char *)kmm_malloc(cache_blocks_size); if (!blockcache[i].out_buffer) { - berr("Failed kmm_malloc for blockcache's out_buffer\n"); + berr("%s blockcache's out_buffer\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); elf_cache_uninit(); return -ENOMEM; } diff --git a/os/binfmt/libelf/libelf_ctors.c b/os/binfmt/libelf/libelf_ctors.c index 1985cff660..1746542709 100644 --- a/os/binfmt/libelf/libelf_ctors.c +++ b/os/binfmt/libelf/libelf_ctors.c @@ -63,6 +63,7 @@ #include #include +#include #include "libelf.h" @@ -119,7 +120,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_allocbuffer(loadinfo); if (ret < 0) { - berr("elf_allocbuffer failed: %d\n", ret); + berr("%s %d\n",clog_message_str[CMN_LOG_FAILED_OP] ret); return -ENOMEM; } @@ -177,7 +178,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) loadinfo->ctors = (binfmt_ctor_t *)kmm_malloc(ctorsize); if (!loadinfo->ctors) { - berr("Failed to allocate memory for .ctors\n"); + berr("%s .ctors\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -185,7 +186,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, (FAR uint8_t *)loadinfo->ctors, ctorsize, shdr->sh_offset); if (ret < 0) { - berr("Failed to allocate .ctors: %d\n", ret); + berr("%s .ctors: %d\n",clog_message_str[CMN_LOG_ALLOC_FAIL], ret); return ret; } diff --git a/os/binfmt/libelf/libelf_dtors.c b/os/binfmt/libelf/libelf_dtors.c index 859bdda707..8c4e63697a 100644 --- a/os/binfmt/libelf/libelf_dtors.c +++ b/os/binfmt/libelf/libelf_dtors.c @@ -63,6 +63,7 @@ #include #include +#include #include "libelf.h" @@ -119,7 +120,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_allocbuffer(loadinfo); if (ret < 0) { - berr("elf_allocbuffer failed: %d\n", ret); + berr("%s elf_allocbuffer(): %d\n", clog_message_str[CMN_LOG_FAILED_OP] ret); return -ENOMEM; } @@ -178,7 +179,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) loadinfo->dtors = (binfmt_dtor_t *)kmm_malloc(dtorsize); if (!loadinfo->dtors) { - berr("Failed to allocate memory for .dtors\n"); + berr("%s .dtors\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -186,7 +187,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, (FAR uint8_t *)loadinfo->dtors, dtorsize, shdr->sh_offset); if (ret < 0) { - berr("Failed to allocate .dtors: %d\n", ret); + berr("%s .dtors: %d\n",clog_message_str[CMN_LOG_ALLOC_FAIL], ret); return ret; } diff --git a/os/binfmt/libelf/libelf_init.c b/os/binfmt/libelf/libelf_init.c index a4645f0419..0719a8af1d 100644 --- a/os/binfmt/libelf/libelf_init.c +++ b/os/binfmt/libelf/libelf_init.c @@ -66,6 +66,7 @@ #include #include +#include #ifdef CONFIG_COMPRESSED_BINARY #include @@ -113,7 +114,7 @@ static inline int elf_filelen(FAR struct elf_loadinfo_s *loadinfo, FAR const cha ret = stat(filename, &buf); if (ret < 0) { int errval = get_errno(); - berr("Failed to stat file: %d\n", errval); + berr("%s to stat file: %d\n", clog_message_str[CMN_LOG_FAILED_OP], errval); return -errval; } @@ -163,7 +164,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) ret = elf_filelen(loadinfo, filename); if (ret < 0) { - berr("elf_filelen failed: %d\n", ret); + berr("%s elf_filelen %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } } @@ -173,14 +174,14 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) loadinfo->filfd = open(filename, O_RDONLY); if (loadinfo->filfd < 0) { ret = loadinfo->filfd; - berr("Failed to open ELF binary %s: %d\n", filename, ret); + berr("%s ELF binary %s: %d\n",clog_message_str[CMN_LOG_FILE_OPEN_ERROR], filename, ret); return ret; } #ifdef CONFIG_COMPRESSED_BINARY ret = compress_init(loadinfo->filfd, loadinfo->offset, &loadinfo->filelen); if (ret != OK) { - berr("Failed to read header for compressed binary : %d\n", ret); + berr("%s read header for compressed binary : %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } #endif @@ -188,7 +189,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) #if defined(CONFIG_ELF_CACHE_READ) ret = elf_cache_init(loadinfo->filfd, loadinfo->offset, loadinfo->filelen); if (ret != OK) { - berr("Failed to init cache support: %d\n", ret); + berr("%s elf_cache_init %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } #endif @@ -196,7 +197,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) /* Read the ELF ehdr from offset 0 */ ret = elf_read(loadinfo, (FAR uint8_t *)&loadinfo->ehdr, sizeof(Elf32_Ehdr), 0); if (ret < 0) { - berr("Failed to read ELF header: %d\n", ret); + berr("%s To read ELF header: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -213,7 +214,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) * is not correctly formed. */ - berr("Bad ELF header: %d\n", ret); + berr("%s ELF header: %d\n", clog_message_str[CMN_LOG_INVALID_VAL], ret); return ret; } diff --git a/os/binfmt/libelf/libelf_iobuffer.c b/os/binfmt/libelf/libelf_iobuffer.c index d230c2b26f..5f04a1a05a 100644 --- a/os/binfmt/libelf/libelf_iobuffer.c +++ b/os/binfmt/libelf/libelf_iobuffer.c @@ -61,6 +61,7 @@ #include #include +#include #include "libelf.h" @@ -102,7 +103,7 @@ int elf_allocbuffer(FAR struct elf_loadinfo_s *loadinfo) loadinfo->iobuffer = (FAR uint8_t *)kmm_malloc(CONFIG_ELF_BUFFERSIZE); if (!loadinfo->iobuffer) { - berr("Failed to allocate an I/O buffer\n"); + berr("%s I/O buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -137,7 +138,7 @@ int elf_reallocbuffer(FAR struct elf_loadinfo_s *loadinfo, size_t increment) buffer = kmm_realloc((FAR void *)loadinfo->iobuffer, newsize); if (!buffer) { - berr("Failed to reallocate the I/O buffer\n"); + berr("%s\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/binfmt/libelf/libelf_load.c b/os/binfmt/libelf/libelf_load.c index b989aff4e4..fccfc16c04 100644 --- a/os/binfmt/libelf/libelf_load.c +++ b/os/binfmt/libelf/libelf_load.c @@ -70,7 +70,7 @@ #include #include #include - +#include #include "libelf.h" /**************************************************************************** @@ -234,7 +234,7 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, *pptr, shdr->sh_size, shdr->sh_offset); if (ret < 0) { - berr("ERROR: Failed to read section %d: %d\n", i, ret); + berr("%s section %d: %d\n",clog_message_str[CMN_LOG_FILE_READ_ERROR], i, ret); return ret; } } @@ -284,7 +284,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_loadshdrs(loadinfo); if (ret < 0) { - berr("ERROR: elf_loadshdrs failed: %d\n", ret); + berr("%s elf_loadshdrs: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffers; } @@ -296,7 +296,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_addrenv_alloc(loadinfo); if (ret < 0) { - berr("ERROR: elf_addrenv_alloc() failed: %d\n", ret); + berr("%s elf_addrenv_alloc(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffers; } @@ -304,7 +304,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_loadfile(loadinfo); if (ret < 0) { - berr("ERROR: elf_loadfile failed: %d\n", ret); + berr("%s elf_loadfile(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffers; } @@ -313,13 +313,13 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) #ifdef CONFIG_BINFMT_CONSTRUCTORS ret = elf_loadctors(loadinfo); if (ret < 0) { - berr("ERROR: elf_loadctors failed: %d\n", ret); + berr("%s elf_loadctors(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffers; } ret = elf_loaddtors(loadinfo); if (ret < 0) { - berr("ERROR: elf_loaddtors failed: %d\n", ret); + berr("%s elf_loaddtors(): %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffers; } #endif diff --git a/os/binfmt/libelf/libelf_read.c b/os/binfmt/libelf/libelf_read.c index fbb583fd81..84b1f6f6e2 100644 --- a/os/binfmt/libelf/libelf_read.c +++ b/os/binfmt/libelf/libelf_read.c @@ -65,7 +65,7 @@ #include #include - +#include #ifdef CONFIG_COMPRESSED_BINARY #include #endif @@ -153,7 +153,7 @@ int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR uint8_t *buffer, size_t re rpos = lseek(loadinfo->filfd, offset, SEEK_SET); if (rpos != offset) { int errval = get_errno(); - berr("Failed to seek to position %lu: %d\n", (unsigned long)offset, errval); + berr("%s position %lu: %d\n",clog_message_str[CMN_LOG_FILE_SEEK_ERROR], (unsigned long)offset, errval); return -errval; } @@ -166,7 +166,7 @@ int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR uint8_t *buffer, size_t re /* EINTR just means that we received a signal */ if (nbytes != -EINTR) { - berr("Read from offset %lu failed: %d\n", (unsigned long)offset, (int)nbytes); + berr("%s %lu: %d\n", clog_message_str[CMN_LOG_FILE_SEEK_ERROR], (unsigned long)offset, (int)nbytes); return nbytes; } } else if (nbytes == 0) { diff --git a/os/binfmt/libelf/libelf_sections.c b/os/binfmt/libelf/libelf_sections.c index 930dbb943d..200c903b05 100644 --- a/os/binfmt/libelf/libelf_sections.c +++ b/os/binfmt/libelf/libelf_sections.c @@ -64,6 +64,7 @@ #include #include +#include #include #include @@ -157,7 +158,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo, FAR const El buffer = &loadinfo->iobuffer[bytesread]; ret = elf_read(loadinfo, buffer, readlen, offset + bytesread); if (ret < 0) { - berr("Failed to read section name\n"); + berr("%s read section name\n",clog_message_str[CMN_LOG_FAILED_OP]); return ret; } @@ -245,7 +246,7 @@ void elf_save_bin_section_addr(struct binary_s *bin) #endif #endif } else { - berr("ERROR : Failed to save bin section addresses\n"); + berr("%s save bin section addresses\n",clog_message_str[CMN_LOG_FAILED_OP]); } } @@ -308,7 +309,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) loadinfo->shdr = (FAR FAR Elf32_Shdr *)kmm_malloc(shdrsize); if (!loadinfo->shdr) { - berr("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize); + berr("%s Size: %ld\n",clog_message_str[CMN_LOG_ALLOC_FAIL], (long)shdrsize); return -ENOMEM; } @@ -316,7 +317,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, (FAR uint8_t *)loadinfo->shdr, shdrsize, loadinfo->ehdr.e_shoff); if (ret < 0) { - berr("Failed to read section header table: %d\n", ret); + berr("%s To read section header table: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; @@ -352,7 +353,7 @@ int elf_findsection(FAR struct elf_loadinfo_s *loadinfo, FAR const char *sectnam shdr = &loadinfo->shdr[i]; ret = elf_sectname(loadinfo, shdr); if (ret < 0) { - berr("elf_sectname failed: %d\n", ret); + berr("%s elf_sectname: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } diff --git a/os/binfmt/libelf/libelf_symbols.c b/os/binfmt/libelf/libelf_symbols.c index 7b915cc68f..1bf2c4166a 100644 --- a/os/binfmt/libelf/libelf_symbols.c +++ b/os/binfmt/libelf/libelf_symbols.c @@ -67,6 +67,7 @@ #include #include #include +#include #include "libelf.h" @@ -104,13 +105,13 @@ int elf_readstrtab(FAR struct elf_loadinfo_s *loadinfo) loadinfo->strtab = (uintptr_t)kmm_malloc(strtab->sh_size); if (!loadinfo->strtab) { - berr("ERROR: Failed to allocate space for str table. Size = %u\n", strtab->sh_size); + berr("%s for str table. Size = %u\n",clog_message_str[CMN_LOG_ALLOC_FAIL], strtab->sh_size); return -ENOMEM; } ret = elf_read(loadinfo, (FAR uint8_t *)loadinfo->strtab, strtab->sh_size, strtab->sh_offset); if (ret != OK) { - berr("ERROR: Failed to load string table into memory\n"); + berr("%s load string table into memory\n",clog_message_str[CMN_LOG_FAILED_OP]); kmm_free((void *)loadinfo->strtab); loadinfo->strtab = (uintptr_t)NULL; return ret; @@ -220,12 +221,12 @@ void elf_readsymtab(FAR struct elf_loadinfo_s *loadinfo) loadinfo->symtab = (uintptr_t)kmm_malloc(symtab->sh_size); if (!loadinfo->symtab) { - berr("ERROR: Failed to allocate space for sym table. Size = %u\n", symtab->sh_size); + berr("%s sym table Size = %u\n",clog_message_str[CMN_LOG_ALLOC_FAIL], symtab->sh_size); return; } if (elf_read(loadinfo, (FAR uint8_t *)loadinfo->symtab, symtab->sh_size, symtab->sh_offset) < 0) { - berr("ERROR: Failed to load symbol table into memory\n"); + berr("%s load symbol table into memory\n",clog_message_str[CMN_LOG_FAILED_OP]); } } @@ -322,7 +323,7 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf32_Sym *sym, FAR co * indicate the nameless symbol. */ - berr("SHN_UNDEF: Failed to get symbol name: %d\n", ret); + berr("%s to get symbol name: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } diff --git a/os/binfmt/libxipelf/xipelf.c b/os/binfmt/libxipelf/xipelf.c index cfc47e397f..f2381dba02 100644 --- a/os/binfmt/libxipelf/xipelf.c +++ b/os/binfmt/libxipelf/xipelf.c @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -56,7 +57,7 @@ static int xipelf_loadbinary(FAR struct binary_s *binp) int filfd = open(binp->filename, O_RDONLY); if (filfd < 0) { ret = filfd; - berr("Failed to open binary %s: %d\n", binp->filename, ret); + berr("%s %s: %d\n",clog_message_str[CMN_LOG_FILE_OPEN_ERROR], binp->filename, ret); return ret; } @@ -71,7 +72,7 @@ static int xipelf_loadbinary(FAR struct binary_s *binp) rpos = lseek(filfd, offset, SEEK_SET); if (rpos != offset) { int errval = get_errno(); - berr("Failed to seek to position %lu: %d\n", (unsigned long)offset, errval); + berr("%s to position %lu: %d\n",clog_message_str[CMN_LOG_FILE_SEEK_ERROR], (unsigned long)offset, errval); close(filfd); return -errval; } @@ -83,12 +84,12 @@ static int xipelf_loadbinary(FAR struct binary_s *binp) /* EINTR just means that we received a signal */ if (nbytes != -EINTR) { - berr("Read from offset %lu failed: %d\n", (unsigned long)offset, (int)nbytes); + berr("%s offset %lu bytes: %d\n", clog_message_str[CMN_LOG_FILE_READ_ERROR], (unsigned long)offset, (int)nbytes); close(filfd); return nbytes; } } else if (nbytes == 0) { - berr("Unexpected end of file\n"); + berr("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); close(filfd); return -ENODATA; } else { @@ -152,7 +153,7 @@ int xipelf_initialize(void) ret = register_binfmt(&g_xipelfbinfmt); if (ret != 0) { - berr("Failed to register binfmt: %d\n", ret); + berr("%s: %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; @@ -240,7 +241,7 @@ void elf_save_bin_section_addr(struct binary_s *bin) binfo(" bss_addr : %x\n", g_bin_addr_list[bin_idx].bss_addr); #endif } else { - berr("ERROR : Failed to save bin section addresses\n"); + berr("%s save bin section addresses\n",clog_message_str[CMN_LOG_FAILED_OP]); } } diff --git a/os/compression/compress.c b/os/compression/compress.c index f72a0860a5..51890d9915 100644 --- a/os/compression/compress.c +++ b/os/compression/compress.c @@ -26,6 +26,7 @@ #include #include +#include #if CONFIG_COMPRESSION_TYPE == LZMA #include @@ -73,13 +74,13 @@ int compress_block(unsigned char *out_buffer, long unsigned int *writesize, unsi unsigned int propsSize = LZMA_PROPS_SIZE; ret = LzmaCompress(&out_buffer[LZMA_PROPS_SIZE], writesize, read_buffer, size, out_buffer, &propsSize, 0, 1 << 13, -1, -1, -1, -1, 1); if (ret == SZ_ERROR_FAIL) { - dbg("Failure to compress with LZMACompress API\n"); + dbg("%s compress with LZMACompress API\n", clog_message_str[CMN_LOG_FAILED_OP] ); ret = -ret; } #elif CONFIG_COMPRESSION_TYPE == MINIZ ret = mz_compress(out_buffer, writesize, read_buffer, size); if (ret != Z_OK) { - dbg("Failure to compress with Miniz's compress API; ret = %d\n", ret); + dbg("%s compress with Miniz's compress API; ret = %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); if (ret > 0) ret = -ret; } @@ -107,7 +108,7 @@ int decompress_block(unsigned char *out_buffer, long unsigned int *writesize, un ret = LzmaUncompress(&out_buffer[0], (unsigned int *)writesize, &read_buffer[LZMA_PROPS_SIZE], (unsigned int *)size, &read_buffer[0], LZMA_PROPS_SIZE); if (ret == SZ_ERROR_FAIL) { - bcmpdbg("Failure to decompress with LZMAUncompress API\n"); + bcmpdbg("%s decompress with LZMAUncompress API\n", clog_message_str[CMN_LOG_FAILED_OP]); ret = -ret; } else if (ret == SZ_OK && *size < read_size) { @@ -122,7 +123,7 @@ int decompress_block(unsigned char *out_buffer, long unsigned int *writesize, un /* Miniz specific logic for decompression */ ret = mz_uncompress(out_buffer, writesize, read_buffer, *size); if (ret != Z_OK) { - bcmpdbg("Failure to decompress with Miniz's uncompress API; ret = %d\n", ret); + bcmpdbg("%s decompress with Miniz's uncompress API; ret = %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); if (ret > 0) ret = -ret; else if (ret == Z_BUF_ERROR) { diff --git a/os/compression/compress_read.c b/os/compression/compress_read.c index 85a8f54f48..e76c3b6d20 100644 --- a/os/compression/compress_read.c +++ b/os/compression/compress_read.c @@ -30,6 +30,7 @@ #include #include +#include #if CONFIG_COMPRESSION_TYPE == LZMA #include @@ -90,7 +91,7 @@ static int compress_parse_header(int filfd, uint16_t offset) rpos = lseek(filfd, offset, SEEK_SET); if (rpos != offset) { int errval = get_errno(); - bcmpdbg("ERROR : lseek to offset %lu failed: %d\n", (unsigned long)offset, errval); + bcmpdbg("%s offset %lu errorno %d\n", clog_message_str[CMN_LOG_FILE_SEEK_ERROR], (unsigned long)offset, errval); return -errval; } @@ -104,7 +105,7 @@ static int compress_parse_header(int filfd, uint16_t offset) /* Allocate memory for compression header now that we know it's size */ compression_header = (struct s_header *)kmm_malloc(compheader_size); if (!compression_header) { - bcmpdbg("Failed kmm_malloc for compression_header\n"); + bcmpdbg("%s compression_header\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -169,7 +170,7 @@ static off_t compress_lseek_block(int filfd, uint16_t binary_header_size, int bl rpos = lseek(filfd, block_offset, SEEK_SET); if (rpos != block_offset) { int errval = get_errno(); - bcmpdbg("Failed to seek to position %lu: %d\n", (unsigned long)block_offset, errval); + bcmpdbg("%s %lu: %d\n", clog_message_str[CMN_LOG_FAILED_OP], (unsigned long)block_offset, errval); return -errval; } @@ -197,7 +198,7 @@ static off_t compress_read_block(int filfd, uint16_t binary_header_size, FAR uin /* Find out size of 'block_number' block in compressed file. Assign to readsize */ next_block_offset = compress_offset_block(filfd, binary_header_size, block_number + 1); if (next_block_offset < 0) { - bcmpdbg("Incorrect offset for block number %d\n", block_number + 1); + bcmpdbg("%s block number %d\n", clog_message_str[CMN_LOG_FILE_SEEK_ERROR], block_number + 1); return ERROR; } @@ -216,7 +217,7 @@ static off_t compress_read_block(int filfd, uint16_t binary_header_size, FAR uin /* Seek to location of 'block_number' block in compressed file */ rpos = compress_lseek_block(filfd, binary_header_size, block_number); if (rpos < 0) { - bcmpdbg("Failed to seek to offset of block number %d\n", block_number); + bcmpdbg("%s block number %d\n", clog_message_str[CMN_LOG_FAILED_OP], block_number); return rpos; } @@ -296,7 +297,7 @@ int compress_read(int filfd, uint16_t binary_header_size, FAR uint8_t *buffer, s /* Decompress block in read_buffer to out_buffer */ ret = decompress_block(buffers.out_buffer, &writesize, buffers.read_buffer, &size); if (ret == ERROR) { - bcmpdbg("Failed to decompress %d block of this binary\n", index); + bcmpdbg(" %s to decompress %d block of this binary\n", clog_message_str[CMN_LOG_FAILED_OP], index); buffer_index = ret; goto error_compress_read; } @@ -351,7 +352,7 @@ int compress_init(int filfd, uint16_t offset, off_t *filelen) /* Parsing compression header for compressed file */ ret = compress_parse_header(filfd, offset); if (ret != OK) { - bcmpdbg("Failed to parse compression header from file\n"); + bcmpdbg("%s to parse compression header from file\n", clog_message_str[CMN_LOG_FAILED_OP]); goto error_compress_init; } diff --git a/os/drivers/analog/adc.c b/os/drivers/analog/adc.c index a88a23a62e..451cc6cd3b 100644 --- a/os/drivers/analog/adc.c +++ b/os/drivers/analog/adc.c @@ -255,7 +255,7 @@ static ssize_t adc_read(FAR struct file *filep, FAR char *buffer, int ret = 0; int msglen; - avdbg("%s %d\n", clog_message_str[CMN_LOG_VALUE_OF], (int)buflen); + avdbg("buflen: %d\n", (int)buflen); if (buflen % 5 == 0) msglen = 5; @@ -358,7 +358,7 @@ static ssize_t adc_read(FAR struct file *filep, FAR char *buffer, leave_critical_section(flags); } - avdbg("%s %d\n", clog_message_str[CMN_LOG_VALUE_OF], ret); + avdbg("Returning: %d\n", ret); return ret; } @@ -545,7 +545,7 @@ int adc_register(FAR const char *path, FAR struct adc_dev_s *dev) DEBUGASSERT(dev->ad_ops != NULL && dev->ad_ops->ao_bind != NULL); ret = dev->ad_ops->ao_bind(dev, &g_adc_callback); if (ret < 0) { - avdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + avdbg("%s to bind callbacks: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } diff --git a/os/drivers/audio/alc1019.c b/os/drivers/audio/alc1019.c index d148e30257..9026784456 100644 --- a/os/drivers/audio/alc1019.c +++ b/os/drivers/audio/alc1019.c @@ -100,7 +100,7 @@ static int alc1019_writereg_3byte(FAR struct alc1019_dev_s *priv, uint8_t regadd ret = i2c_write(dev, alc1019_i2c_config, (uint8_t *)reg, 3); if (ret < 0) { - auddbg("%s, 0x%x/0x%x/0x%x\n", clog_message_str[CMN_LOG_FAILED_OP] ,regaddr_h, regaddr_l, regval); + auddbg("%s to write reg, 0x%x/0x%x/0x%x\n", clog_message_str[CMN_LOG_FAILED_OP] ,regaddr_h, regaddr_l, regval); } return ret; } @@ -434,12 +434,12 @@ static int alc1019_configure(FAR struct audio_lowerhalf_s *dev, FAR const struct ret = -EDOM; if (caps->ac_channels != ALC1019_CHANNELS) { - auddbg("%s#1 %d\n", clog_message_str[CMN_LOG_INVALID_VAL], caps->ac_channels); + auddbg("%s number of channels %d\n", clog_message_str[CMN_LOG_INVALID_VAL], caps->ac_channels); break; } if (caps->ac_controls.b[2] != ALC1019_BPSAMP) { - auddbg("%s#2 %d\n",clog_message_str[CMN_LOG_INVALID_VAL], caps->ac_controls.b[2]); + auddbg("%s bits per sample %d\n",clog_message_str[CMN_LOG_INVALID_VAL], caps->ac_controls.b[2]); break; } diff --git a/os/drivers/audio/alc5658.c b/os/drivers/audio/alc5658.c index 9fee50af20..7a3f702a34 100644 --- a/os/drivers/audio/alc5658.c +++ b/os/drivers/audio/alc5658.c @@ -79,7 +79,6 @@ #include #include #include -#include #include "alc5658.h" #include "alc5658scripts.h" diff --git a/os/drivers/audio/audio_null.c b/os/drivers/audio/audio_null.c index b4b263d0d3..d9f374d4a6 100644 --- a/os/drivers/audio/audio_null.c +++ b/os/drivers/audio/audio_null.c @@ -703,7 +703,7 @@ static int null_registerprocess(FAR struct audio_lowerhalf_s *dev, mqd_t mq) priv->process_terminate = false; ret = pthread_create(&priv->process_threadid, &tattr, null_processthread, (pthread_addr_t) priv); if (ret != OK) { - auddbg("%s %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); + auddbg("Pthread_create() %s : %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } else { pthread_setname_np(priv->process_threadid, "null audio process"); auddbg("%s \n", clog_message_str[CMN_LOG_PERFORMING_OP]); @@ -767,7 +767,7 @@ static int null_start(FAR struct audio_lowerhalf_s *dev) audvdbg("Starting worker thread\n"); ret = pthread_create(&priv->worker_threadid, &tattr, null_workerthread, (pthread_addr_t) priv); if (ret != OK) { - auddbg("%s %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); + auddbg("%s: pthread_create(), %d\n",clog_message_str[CMN_LOG_FAILED_OP], ret); } else { pthread_setname_np(priv->worker_threadid, "null audio"); auddbg("Created worker thread\n"); @@ -962,12 +962,12 @@ static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, unsigned long #endif ret = null_registerprocess(dev, (mqd_t) arg); if (ret != OK) { - auddbg("%s#1 %d \n", clog_message_str[CMN_LOG_FAILED_OP], ret); + auddbg("%s to start: %d \n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } ret = OK; #else - auddbg("%s#2 \n", clog_message_str[CMN_LOG_FAILED_OP]); + auddbg("%s Register - Device not supported \n", clog_message_str[CMN_LOG_FAILED_OP]); ret = -EINVAL; #endif } @@ -976,13 +976,13 @@ static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, unsigned long #ifdef CONFIG_AUDIO_PROCESSING_FEATURES ret = null_unregisterprocess(dev); if (ret != OK) { - auddbg("%s#3 %d \n", clog_message_str[CMN_LOG_FAILED_OP], ret); + auddbg("%s to start : %d \n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } ret = OK; #else - auddbg("%s#4 \n", clog_message_str[CMN_LOG_FAILED_OP]); + auddbg("UnRegister %s\n", clog_message_str[CMN_LOG_FAILED_OP]); ret = -EINVAL; #endif } @@ -996,7 +996,7 @@ static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, unsigned long sem_post(&priv->processing_sem); ret = OK; #else - auddbg("%s #5\n", clog_message_str[CMN_LOG_FAILED_OP]); + auddbg("%s to start\n", clog_message_str[CMN_LOG_FAILED_OP]); ret = -EINVAL; #endif } @@ -1009,7 +1009,7 @@ static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, unsigned long priv->process_terminate = true; ret = OK; #else - auddbg("%s #6\n:", clog_message_str[CMN_LOG_FAILED_OP]); + auddbg("%s to start\n:", clog_message_str[CMN_LOG_FAILED_OP]); ret = -EINVAL; #endif } @@ -1113,6 +1113,6 @@ FAR struct audio_lowerhalf_s *audio_null_initialize(void) return &priv->dev; } - auddbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); + auddbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); return NULL; } diff --git a/os/drivers/audio/cx20921.c b/os/drivers/audio/cx20921.c index 84aee9a5b0..2f07b0fd61 100644 --- a/os/drivers/audio/cx20921.c +++ b/os/drivers/audio/cx20921.c @@ -74,7 +74,6 @@ #include #include #include -#include #include "cx20921.h" diff --git a/os/drivers/audio/tas5749.c b/os/drivers/audio/tas5749.c index 7a7b5009c8..8ced11a5c2 100644 --- a/os/drivers/audio/tas5749.c +++ b/os/drivers/audio/tas5749.c @@ -159,7 +159,7 @@ uint8_t tas5749_readreg_1byte(FAR struct tas5749_dev_s *priv, uint8_t regaddr) uint8_t reg_w[4]; reg_w[0] = regaddr; if (i2c_writeread(dev, tas5749_i2c_config, reg_w, 1, reg, 1) < 0) { - auddbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); + auddbg("%s to read reg: %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); return FAIL_8; } return reg[0]; @@ -184,12 +184,12 @@ uint32_t tas5749_readreg_4byte(FAR struct tas5749_dev_s *priv, uint8_t regaddr) ret = i2c_write(dev, tas5749_i2c_config, reg, 1); if (ret < 0) { - auddbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); + auddbg("%s to read reg: %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); return FAIL_32; } ret = i2c_read(dev, tas5749_i2c_config, reg, 4); if (ret < 0) { - auddbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); + auddbg("%s to read reg: %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); return FAIL_32; } regval = ((reg[0] << 24) | (reg[1] << 16) | (reg[2] << 8) | (reg[3] << 24)); @@ -226,7 +226,7 @@ static int tas5749_writereg_1byte(FAR struct tas5749_dev_s *priv, uint8_t regadd ret = i2c_write(dev, tas5749_i2c_config, (uint8_t *)reg, 2); if (ret < 0) { - auddbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); + auddbg("%s write reg: %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); } return ret; } @@ -253,7 +253,7 @@ static int tas5749_writereg_4byte(FAR struct tas5749_dev_s *priv, uint8_t regadd ret = i2c_write(dev, tas5749_i2c_config, (uint8_t *)reg, 5); if (ret < 0) { - auddbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); + auddbg("%s to write reg: %d\n", clog_message_str[CMN_LOG_FAILED_OP],regaddr); } return ret; } @@ -1238,7 +1238,7 @@ FAR struct audio_lowerhalf_s *tas5749_initialize(FAR struct i2c_dev_s *i2c, FAR /* Verify that TAS5749 is present and available on this I2C */ regval = tas5749_readreg_1byte(priv, TAS5749_TI_DEVICE_ID); if (regval != TAS5749_TI_DEVICE_ID_VAL) { - auddbg("%s %04xn", clog_message_str[CMN_LOG_INVALID_VAL],regval); + auddbg("%s ID=%04xn", clog_message_str[CMN_LOG_INVALID_VAL],regval); goto errout_with_dev; } diff --git a/os/drivers/bch/bchdev_register.c b/os/drivers/bch/bchdev_register.c index 55b3a7855b..79125cc19c 100644 --- a/os/drivers/bch/bchdev_register.c +++ b/os/drivers/bch/bchdev_register.c @@ -84,14 +84,14 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev, bool readon /* Setup the BCH lib functions */ ret = bchlib_setup(blkdev, readonly, &handle); if (ret < 0) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); + fdbg("bchlib_setup %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); return ret; } /* Then setup the character device */ ret = register_driver(chardev, &bch_fops, 0666, handle); if (ret < 0) { - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); + fdbg("register_driver%s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); bchlib_teardown(handle); handle = NULL; } diff --git a/os/drivers/bch/bchlib_read.c b/os/drivers/bch/bchlib_read.c index 3e29482591..2f1330a0ea 100644 --- a/os/drivers/bch/bchlib_read.c +++ b/os/drivers/bch/bchlib_read.c @@ -109,7 +109,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t le } if (bch->sectsize <= 0) { - fdbg("%s bch->sectsize : %d\n", clog_message_str[CMN_LOG_VALUE_OF],bch->sectsize); + fdbg("%s bch->sectsize : %d\n", clog_message_str[CMN_LOG_INVALID_VAL],bch->sectsize); return -1; } diff --git a/os/drivers/bch/bchlib_setup.c b/os/drivers/bch/bchlib_setup.c index fbd4422a2f..e278335bd9 100644 --- a/os/drivers/bch/bchlib_setup.c +++ b/os/drivers/bch/bchlib_setup.c @@ -94,14 +94,14 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) /* Allocate the BCH state structure */ bch = (FAR struct bchlib_s *)kmm_zalloc(sizeof(struct bchlib_s)); if (!bch) { - fdbg("%s#1\n", clog_message_str[CMN_LOG_FAILED_OP]); + fdbg("BCH structure %s\n", clog_message_str[CMN_LOG_FAILED_OP]); return -ENOMEM; } /* Open the block driver */ ret = open_blockdriver(blkdev, readonly ? MS_RDONLY : 0, &bch->inode); if (ret < 0) { - fdbg("%s#2 %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],blkdev,-ret); + fdbg("open_blockdriver %s of %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],blkdev,-ret); goto errout_with_bch; } @@ -109,18 +109,18 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) ret = bch->inode->u.i_bops->geometry(bch->inode, &geo); if (ret < 0) { - fdbg("%s#3 %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); + fdbg("Geometry %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); goto errout_with_bch; } if (!geo.geo_available) { - fdbg("%s#4 %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); + fdbg("Geometry %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],-ret); ret = -ENODEV; goto errout_with_bch; } if (!readonly && (!bch->inode->u.i_bops->write || !geo.geo_writeenabled)) { - fdbg("%s#5 \n", clog_message_str[CMN_LOG_FAILED_OP]); + fdbg("%s to write.\n", clog_message_str[CMN_LOG_FAILED_OP]); ret = -EACCES; goto errout_with_bch; } @@ -135,7 +135,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) /* Allocate the sector I/O buffer */ bch->buffer = (FAR uint8_t *)kmm_malloc(bch->sectsize); if (!bch->buffer) { - fdbg("%s#6 \n", clog_message_str[CMN_LOG_FAILED_OP]); + fdbg("%s buffer \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); ret = -ENOMEM; goto errout_with_bch; } diff --git a/os/drivers/bch/bchlib_write.c b/os/drivers/bch/bchlib_write.c index fe3bafb5af..efc3d5fa1a 100644 --- a/os/drivers/bch/bchlib_write.c +++ b/os/drivers/bch/bchlib_write.c @@ -184,7 +184,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si /* Finally, flush any cached writes to the device as well */ ret = bchlib_flushsector(bch); if (ret < 0) { - fdbg("%s %d\n", clog_message_str[CMN_LOG_INVALID_VAL],ret); + fdbg("%s to Flush: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); return ret; } diff --git a/os/drivers/bluetooth/bt_null/bt_null.c b/os/drivers/bluetooth/bt_null/bt_null.c index 3ad8005066..dc6f501272 100644 --- a/os/drivers/bluetooth/bt_null/bt_null.c +++ b/os/drivers/bluetooth/bt_null/bt_null.c @@ -361,7 +361,7 @@ static int btnull_send(FAR const struct bt_driver_s *dev, FAR struct bt_buf_s *b outbuf = bt_buf_alloc(BT_EVT, NULL, 0); if (outbuf == NULL) { - ndbg("%d#1 \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + ndbg("%d bt_buf_alloc\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -398,11 +398,11 @@ static int btnull_send(FAR const struct bt_driver_s *dev, FAR struct bt_buf_s *b status = pthread_attr_init(&attr); if (status != 0) { - ndbg("%s #2 :\n", clog_message_str[CMN_LOG_FAILED_OP]); + ndbg("%s of pthread_attr_init()\n", clog_message_str[CMN_LOG_FAILED_OP]); } status = pthread_create(&tid, &attr, (pthread_startroutine_t)btnull_adv_report, NULL); if (status < 0) { - ndbg("%s #3 :\n", clog_message_str[CMN_LOG_FAILED_OP]); + ndbg("%s of pthread_create\n", clog_message_str[CMN_LOG_FAILED_OP]); } } break; diff --git a/os/drivers/fota/fota_driver.c b/os/drivers/fota/fota_driver.c index 32cbacc82e..341318cd52 100644 --- a/os/drivers/fota/fota_driver.c +++ b/os/drivers/fota/fota_driver.c @@ -36,7 +36,6 @@ #include #include #include -#include /************************************************************************************ * Definitions @@ -86,8 +85,7 @@ static ssize_t fota_write(FAR struct file *filep, FAR const char *buffer, size_t int ret = ERROR; if (!g_fota_dev_opened) { - //dbg(" device is not opened, ret = %d\n", ret); - dbg("%s %d \n", clog_message_str[CMN_LOG_VALUE_OF],ret); + dbg(" device is not opened, ret = %d\n", ret); set_errno(EBADF); return ret; } @@ -110,8 +108,7 @@ static ssize_t fota_read(FAR struct file *filep, FAR char *buffer, size_t buflen int ret = ERROR; if (!g_fota_dev_opened) { - //dbg(" device is not opened, ret = %d\n", ret); - dbg("%s %d \n", clog_message_str[CMN_LOG_VALUE_OF],ret); + dbg(" device is not opened, ret = %d\n", ret); set_errno(EBADF); return ret; } @@ -130,8 +127,7 @@ static int fota_ioctl(FAR struct file *filep, int cmd, unsigned long arg) int ret = ERROR; if (!g_fota_dev_opened) { - //dbg(" device is not opened, ret = %d\n", ret); - dbg("%s %d \n", clog_message_str[CMN_LOG_VALUE_OF],ret); + dbg(" device is not opened, ret = %d\n", ret); set_errno(EBADF); return ret; } @@ -178,8 +174,7 @@ static int fota_close(FAR struct file *filep) FAR fota_dev_t *dev = inode->i_private; if (!g_fota_dev_opened) { - //dbg(" device is not opened, ret = %d\n", ERROR); - dbg("%s %d \n", clog_message_str[CMN_LOG_VALUE_OF],ERROR); + dbg(" device is not opened, ret = %d\n", ERROR); set_errno(EBADF); return ERROR; } @@ -231,7 +226,7 @@ int fota_register(FAR fota_dev_t *dev) sem_init(&g_fota_open_sem, 0, 1); - dbg("%s %s\n", clog_message_str[CMN_LOG_VALUE_OF],path); + dbg("Registering %s\n", path); if (!dev) { return ERROR; diff --git a/os/drivers/gpio/gpio.c b/os/drivers/gpio/gpio.c index 4655ff6706..d7d3dc4214 100644 --- a/os/drivers/gpio/gpio.c +++ b/os/drivers/gpio/gpio.c @@ -500,7 +500,7 @@ static int gpio_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Get exclusive access to the driver structure */ ret = gpio_takesem(&priv->gu_exclsem); if (ret < 0) { - lldbg("%s#1 %d \n", clog_message_str[CMN_LOG_INVALID_VAL],ret); + lldbg("%s of gpio_takesem: %d \n", clog_message_str[CMN_LOG_FAILED_OP],ret); return ret; } @@ -522,7 +522,7 @@ static int gpio_poll(FAR struct file *filep, FAR struct pollfd *fds, } if (i >= CONFIG_GPIO_NPOLLWAITERS) { - lldbg("%s#2 \n", clog_message_str[CMN_LOG_INVALID_VAL]); + lldbg("%s poll waiters \n", clog_message_str[CMN_LOG_INVALID_VAL]); fds->priv = NULL; ret = -EBUSY; goto errout_with_dusem; @@ -584,7 +584,7 @@ static int gpio_close(FAR struct file *filep) /* Get exclusive access to the driver structure */ ret = gpio_takesem(&priv->gu_exclsem); if (ret < 0) { - lldbg("%s %d \n", clog_message_str[CMN_LOG_INVALID_VAL],ret); + lldbg("%s of gpio_takesem: %d \n", clog_message_str[CMN_LOG_FAILED_OP],ret); return ret; } @@ -663,7 +663,7 @@ static int gpio_open(FAR struct file *filep) /* Allocate a new open structure */ opriv = (FAR struct gpio_open_s *)kmm_zalloc(sizeof(struct gpio_open_s)); if (!opriv) { - lldbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); + lldbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); ret = -ENOMEM; goto errout_with_sem; } @@ -707,10 +707,9 @@ int gpio_register(unsigned int minor, FAR struct gpio_lowerhalf_s *lower) DEBUGASSERT(lower); /* Allocate a new GPIO driver instance */ - priv = (FAR struct gpio_upperhalf_s *) - kmm_zalloc(sizeof(struct gpio_upperhalf_s)); + priv = (FAR struct gpio_upperhalf_s *)kmm_zalloc(sizeof(struct gpio_upperhalf_s)); if (!priv) { - lldbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); + lldbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/drivers/iotdev/iotbus_sig.c b/os/drivers/iotdev/iotbus_sig.c index edbb8dd4f5..ab2a5f9f57 100644 --- a/os/drivers/iotdev/iotbus_sig.c +++ b/os/drivers/iotdev/iotbus_sig.c @@ -91,7 +91,7 @@ static int iotbus_sig_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case IOTBUS_INTR_REGISTER: { ret = sem_wait(&upper->exclsem[info->int_type]); if (ret < 0) { - ibdbg("%s#1 \n", clog_message_str[CMN_LOG_FAILED_OP]); + ibdbg("%s register interrupt callback \n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } struct int_node_s *itr = upper->table[info->int_type]; @@ -135,7 +135,7 @@ static int iotbus_sig_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case IOTBUS_INTR_UNREGISTER: { ret = sem_wait(&upper->exclsem[info->int_type]); if (ret < 0) { - ibdbg("%s#2 \n", clog_message_str[CMN_LOG_FAILED_OP]); + ibdbg("%s unregister interrupt callback \n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } diff --git a/os/drivers/lcd/ili9341.c b/os/drivers/lcd/ili9341.c index 867308a987..d0fb0692da 100644 --- a/os/drivers/lcd/ili9341.c +++ b/os/drivers/lcd/ili9341.c @@ -72,9 +72,6 @@ #include #include #include -#include - - #include diff --git a/os/drivers/lcd/lcd_dev.c b/os/drivers/lcd/lcd_dev.c index 72c6f04974..41d1e4ec6b 100644 --- a/os/drivers/lcd/lcd_dev.c +++ b/os/drivers/lcd/lcd_dev.c @@ -67,7 +67,6 @@ #include #include #include -#include #define MAX_NO_PLANES 3 /**************************************************************************** @@ -311,7 +310,7 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; default: { - lcddbg("%s %d \n", clog_message_str[CMN_LOG_INVALID_VAL],cmd); + lcddbg("ERROR: Unsupported IOCTL command: %d\n", cmd); ret = -ENOSYS; } break; diff --git a/os/drivers/lcd/lcd_framebuffer.c b/os/drivers/lcd/lcd_framebuffer.c index 064f21e184..28a9b59280 100644 --- a/os/drivers/lcd/lcd_framebuffer.c +++ b/os/drivers/lcd/lcd_framebuffer.c @@ -255,7 +255,7 @@ static int lcdfb_update(FAR struct lcdfb_dev_s *priv, dmabuff = (uint8_t *)kmm_malloc(height * bytespl); if (dmabuff == NULL) { - gdbg("%s \n", clog_message_str[CMN_LOG_OUT_OF_MEMORY]); + gdbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -285,7 +285,7 @@ static int lcdfb_update(FAR struct lcdfb_dev_s *priv, } if (ret < 0) { - gdbg("%s %d \n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } return ret; @@ -336,7 +336,7 @@ static int lcdfb_getvideoinfo(FAR struct fb_vtable_s *vtable, DEBUGASSERT(lcd->getvideoinfo != NULL); ret = lcd->getvideoinfo(lcd, vinfo); if (ret < 0) { - gdbg("%s getvideoinfo :%d \n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s :%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } } @@ -397,7 +397,7 @@ static int lcdfb_getcmap(FAR struct fb_vtable_s *vtable, DEBUGASSERT(lcd->getcmap != NULL); ret = lcd->getcmap(lcd, cmap); if (ret < 0) { - gdbg("%s getcmap : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } } @@ -429,7 +429,7 @@ static int lcdfb_putcmap(FAR struct fb_vtable_s *vtable, DEBUGASSERT(lcd->putcmap != NULL); ret = lcd->putcmap(lcd, cmap); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } } @@ -462,7 +462,7 @@ static int lcdfb_getcursor(FAR struct fb_vtable_s *vtable, DEBUGASSERT(lcd->getcursor != NULL); ret = lcd->getcursor(lcd, attrib); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } } @@ -537,7 +537,7 @@ int up_fbinitialize(int display) priv = (FAR struct lcdfb_dev_s *)kmm_zalloc(sizeof(struct lcdfb_dev_s)); if (priv == NULL) { - gdbg("%s #1\n", clog_message_str[CMN_LOG_FAILED_OP]); + gdbg("%s state structure \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -561,7 +561,7 @@ int up_fbinitialize(int display) lcd = board_graphics_setup(display); if (lcd == NULL) { - gdbg("%s #2%d\n", clog_message_str[CMN_LOG_FAILED_OP],display); + gdbg("%s of board_graphics_setup, devno=%d\n", clog_message_str[CMN_LOG_FAILED_OP],display); return EXIT_FAILURE; } #else @@ -569,7 +569,7 @@ int up_fbinitialize(int display) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("%s #3 :%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("%s of board_lcd_initialize() :%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); goto errout_with_state; } @@ -577,7 +577,7 @@ int up_fbinitialize(int display) lcd = board_lcd_getdev(display); if (lcd == NULL) { - gdbg("%s #4 :%d\n", clog_message_str[CMN_LOG_FAILED_OP],display); + gdbg("%s of board_lcd_getdev :%d\n", clog_message_str[CMN_LOG_FAILED_OP],display); ret = -ENODEV; goto errout_with_lcd; } @@ -590,7 +590,7 @@ int up_fbinitialize(int display) DEBUGASSERT(lcd->getvideoinfo != NULL); ret = lcd->getvideoinfo(lcd, &vinfo); if (ret < 0) { - gdbg("%s #5 :%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("LCD getvideoinfo() %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); goto errout_with_lcd; } @@ -600,7 +600,7 @@ int up_fbinitialize(int display) DEBUGASSERT(lcd->getplaneinfo != NULL); ret = lcd->getplaneinfo(lcd, VIDEO_PLANE, &priv->pinfo); if (ret < 0) { - gdbg("%s #6 :%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("LCD getplaneinfo() %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); goto errout_with_lcd; } @@ -611,7 +611,7 @@ int up_fbinitialize(int display) priv->fbmem = (FAR uint8_t *)kmm_zalloc(priv->fblen); if (priv->fbmem == NULL) { - gdbg("%s #7 \n", clog_message_str[CMN_LOG_FAILED_OP]); + gdbg("%s frame buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); ret = -ENOMEM; goto errout_with_lcd; } @@ -630,7 +630,7 @@ int up_fbinitialize(int display) ret = lcdfb_update(priv, &rect); if (ret < 0) { - gdbg("%s #8%d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + gdbg("FB update %s %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); } /* Turn the LCD on at 75% power */ diff --git a/os/drivers/lcd/mipi_lcd.c b/os/drivers/lcd/mipi_lcd.c index a3db86f8e5..015901c02f 100644 --- a/os/drivers/lcd/mipi_lcd.c +++ b/os/drivers/lcd/mipi_lcd.c @@ -77,8 +77,7 @@ static int send_cmd(struct mipi_lcd_dev_s *priv, lcm_setting_table_t command) transfer_status = mipi_dsi_transfer(priv->dsi_dev, &msg); priv->config->lcd_mode_switch(true); if (transfer_status != OK) { - lcddbg("Command %x not sent \n", cmd); - lcddbg("%s %x\n", clog_); + lcddbg("%s %x\n", clog_message_str[CMN_LOG_FAILED_OP], cmd); } return transfer_status; } diff --git a/os/drivers/mipidsi/mipi_dsi_device.c b/os/drivers/mipidsi/mipi_dsi_device.c index 7d45360689..3f826ae51c 100644 --- a/os/drivers/mipidsi/mipi_dsi_device.c +++ b/os/drivers/mipidsi/mipi_dsi_device.c @@ -928,7 +928,7 @@ FAR struct mipi_dsi_device *mipi_dsi_device_register(FAR struct mipi_dsi_host *h DEBUGASSERT(host != NULL && name != NULL); if (channel > 3) { - mipidbg("%s %u\n", clog_message_str[CMN_LOG_INVALID_VAL],channel); + mipidbg("%s channel: %u\n", clog_message_str[CMN_LOG_INVALID_VAL],channel); return NULL; } diff --git a/os/drivers/mipidsi/mipi_dsi_packet.c b/os/drivers/mipidsi/mipi_dsi_packet.c index d1441f4068..623a3f6f1b 100644 --- a/os/drivers/mipidsi/mipi_dsi_packet.c +++ b/os/drivers/mipidsi/mipi_dsi_packet.c @@ -187,11 +187,11 @@ bool mipi_dsi_packet_format_is_long(uint8_t type) int mipi_dsi_create_packet(FAR struct mipi_dsi_packet *packet, FAR const struct mipi_dsi_msg *msg) { if (packet == NULL) { - mipidbg("%s#1 \n", clog_message_str[CMN_LOG_INVALID_VAL]); + mipidbg("%s of packet\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return -EINVAL; } if (msg == NULL) { - mipidbg("%s#2 \n", clog_message_str[CMN_LOG_INVALID_VAL]); + mipidbg("%s of message\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return -EINVAL; } diff --git a/os/drivers/net/enc28j60.c b/os/drivers/net/enc28j60.c index ad0dfb4592..336e7836e8 100644 --- a/os/drivers/net/enc28j60.c +++ b/os/drivers/net/enc28j60.c @@ -2359,7 +2359,7 @@ static int enc_reset(FAR struct enc_driver_s *priv) regval = enc_rdbreg(priv, ENC_EREVID); if (regval == 0x00 || regval == 0xff) { - nlldbg("%s %02x\n", clog_message_str[CMN_LOG_INVALID_VAL],regval); + nlldbg("%s ID=%02x\n", clog_message_str[CMN_LOG_INVALID_VAL],regval); return -ENODEV; } @@ -2418,7 +2418,7 @@ static int enc_reset(FAR struct enc_driver_s *priv) enc_wrphy(priv, ENC_PHCON1, PHCON1_PDPXMD); enc_wrphy(priv, ENC_PHCON2, 0x00); #endif - nllvdbg("%s\n", clog_message_str[CMN_LOG_PERFORMING_OP]); + nllvdbg("ENC_RESET SUCCESS\n"); return OK; } diff --git a/os/drivers/net/telnet.c b/os/drivers/net/telnet.c index fc416bf0a0..787c258f6b 100644 --- a/os/drivers/net/telnet.c +++ b/os/drivers/net/telnet.c @@ -665,7 +665,7 @@ static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer, size ret = send(priv->td_psock, priv->td_txbuffer, ncopied, 0); if (ret < 0) { - nlldbg("%s #1 '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP],priv->td_txbuffer, ret); + nlldbg("%s of psock_send '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP],priv->td_txbuffer, ret); return ret; } @@ -680,7 +680,7 @@ static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer, size if (ncopied > 0) { ret = send(priv->td_psock, priv->td_txbuffer, ncopied, 0); if (ret < 0) { - nlldbg("%s #2 '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP],priv->td_txbuffer, ret); + nlldbg("%s: psock_send'%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP],priv->td_txbuffer, ret); return ret; } } @@ -723,7 +723,7 @@ static int telnet_session(FAR struct telnet_session_s *session) priv = (FAR struct telnet_dev_s *)kmm_malloc(sizeof(struct telnet_dev_s)); if (!priv) { - nlldbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); + nlldbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/drivers/os_api_test/kernel/test_clock.c b/os/drivers/os_api_test/kernel/test_clock.c index 4b918df918..b5127fa502 100644 --- a/os/drivers/os_api_test/kernel/test_clock.c +++ b/os/drivers/os_api_test/kernel/test_clock.c @@ -47,7 +47,7 @@ static int test_clock_abstime2ticks(unsigned long arg) ret_chk = clock_gettime(CLOCK_REALTIME, &cur_time); if (ret_chk != OK) { - dbg("%s#1 %d\n", clog_message_str[CMN_LOG_FAILED_OP],get_errno()); + dbg("%s: clock_gettime %d\n", clog_message_str[CMN_LOG_FAILED_OP],get_errno()); return ERROR; } @@ -58,19 +58,19 @@ static int test_clock_abstime2ticks(unsigned long arg) comparison_time.tv_nsec = cur_time.tv_nsec; ret_chk = clock_abstime2ticks(CLOCK_REALTIME, &base_time, &base_tick); if (ret_chk == ERROR) { - dbg("%s#2 %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret_chk); + dbg("%s: clock_abstime2ticks %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret_chk); return ERROR; } ret_chk = clock_abstime2ticks(CLOCK_REALTIME, &comparison_time, &comparison_tick); if (ret_chk != OK) { - dbg("%s#3 %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret_chk); + dbg("%s: clock_abstime2ticks %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret_chk); return ERROR; } clock_ticks2time(comparison_tick - base_tick, &result_time); if (result_time.tv_sec != 1) { - dbg("clock_abstime2ticks failed. %d.%ld sec is not 1 sec.\n", result_time.tv_sec, result_time.tv_nsec); + dbg("%s: clock_ticks2time %d,%ld sec is not 1 sec.\n",clog_message_str[CMN_LOG_FAILED_OP], result_time.tv_sec, result_time.tv_nsec); return ERROR; } return OK; diff --git a/os/drivers/os_api_test/kernel/test_group.c b/os/drivers/os_api_test/kernel/test_group.c index 7e90db26aa..44877dd762 100644 --- a/os/drivers/os_api_test/kernel/test_group.c +++ b/os/drivers/os_api_test/kernel/test_group.c @@ -84,13 +84,13 @@ static int test_group_exit_child(unsigned long arg) child_pid = kernel_thread("group", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, group_exitchild_func, (char *const *)NULL); if (child_pid < 0) { - dbg("%s#1\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: kernel_thread\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } child = group_findchild(group, child_pid); if (child == NULL) { - dbg("%s#2\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s \n",clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } @@ -98,13 +98,13 @@ static int test_group_exit_child(unsigned long arg) child_returned = group_exitchild(group); if (child != child_returned) { - dbg("%s#3\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_exitchild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } child_returned = group_removechild(group, child_pid); if (child != child_returned) { - dbg("%s#4\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_removechild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -125,7 +125,7 @@ static int test_group_add_fined_remove(unsigned long arg) child = group_allocchild(); if (child == NULL) { - dbg("%s#5\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_allocchild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -139,19 +139,19 @@ static int test_group_add_fined_remove(unsigned long arg) /* cross check starts */ child_returned = group_findchild(group, child_pid); if (child != child_returned) { - dbg("%s#6\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_findchild\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_addchild; } child_returned = group_removechild(group, child_pid); if (child != child_returned) { - dbg("%s#7\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_removechild\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_addchild; } child_returned = group_findchild(group, child_pid); if (child_returned != NULL) { - dbg("%s#8\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_findchild\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_addchild; } group_freechild(child); @@ -175,18 +175,18 @@ static int test_group_alloc_free(unsigned long arg) child = group_allocchild(); if (child == NULL) { - dbg("%s#1\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_allocchild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } if (child->flink != NULL) { - dbg("%s#2\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_allocchild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } child->flink = &child_dummy; group_freechild(child); if (child->flink == &child_dummy) { - dbg("%s#3\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_freechild\n",clog_message_str[CMN_LOG_FAILED_OP]); group_freechild(child); return ERROR; } @@ -206,7 +206,7 @@ static int test_group_removechildren(unsigned long arg) child = group_allocchild(); if (child == NULL) { - dbg("%s#1\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_allocchild\n",clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -220,13 +220,13 @@ static int test_group_removechildren(unsigned long arg) /* cross check starts */ child_returned = group_findchild(group, child_pid); if (child != child_returned) { - dbg("%s#2\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_findchild\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_addchild; } group_removechildren(group); if (group->tg_children != NULL) { - dbg("%s#3\n",clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: group_removechild\n",clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_addchild; } group_freechild(child); diff --git a/os/drivers/os_api_test/kernel/test_sem.c b/os/drivers/os_api_test/kernel/test_sem.c index 40341586eb..2c6b397263 100644 --- a/os/drivers/os_api_test/kernel/test_sem.c +++ b/os/drivers/os_api_test/kernel/test_sem.c @@ -47,7 +47,7 @@ static int test_sem_tick_wait(unsigned long arg) ret_chk = sem_init(&sem, 0, 1); if (ret_chk != OK) { - dbg("%s#1 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_init\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -55,35 +55,35 @@ static int test_sem_tick_wait(unsigned long arg) ret_chk = clock_gettime(CLOCK_REALTIME, &base_time); if (ret_chk != OK) { - dbg("%s#2 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: clock_gettime\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_tickwait(&sem, clock(), 2); if (ret_chk != OK) { - dbg("%s#3 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_tickwait\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = clock_gettime(CLOCK_REALTIME, &cur_time); if (ret_chk != OK) { - dbg("%s#4 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: clock_gettime \n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } if (base_time.tv_sec + 2 == cur_time.tv_sec) { - dbg("%s#5 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: clock_gettime \n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_post(&sem); if (ret_chk != OK) { - dbg("%s#6 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_post\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_destroy(&sem); if (ret_chk != OK) { - dbg("%s#7 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_destroy\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } @@ -91,7 +91,7 @@ static int test_sem_tick_wait(unsigned long arg) ret_chk = sem_init(&sem, 0, 0); if (ret_chk != OK) { - dbg("%s#8 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_init\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -99,25 +99,25 @@ static int test_sem_tick_wait(unsigned long arg) ret_chk = sem_tickwait(&sem, clock() - 2, 0); if (ret_chk != ERROR) { - dbg("%s#9 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_tickwait \n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_tickwait(&sem, clock() - 2, 1); if (ret_chk != ERROR) { - dbg("%s#10 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_tickwait\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_tickwait(&sem, clock() - 2, 3); if (ret_chk != ERROR) { - dbg("%s#11 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_tickwait \n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } ret_chk = sem_destroy(&sem); if (ret_chk != OK) { - dbg("%s#12 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: sem_destroy \n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout_with_sem_init; } diff --git a/os/drivers/os_api_test/kernel/test_timer.c b/os/drivers/os_api_test/kernel/test_timer.c index 164c33c165..c9bf956e96 100644 --- a/os/drivers/os_api_test/kernel/test_timer.c +++ b/os/drivers/os_api_test/kernel/test_timer.c @@ -72,12 +72,12 @@ static int test_timer_initialize(unsigned long arg) /* check the count for g_alloctimers and g_freetimers after create now they change */ ret_chk = timer_create(CLOCK_REALTIME, &st_sigevent, &timer_id); if (ret_chk == ERROR) { - dbg("%s#1 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: timer_create \n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } if (timer_id == NULL) { - dbg("%s#2 \n", clog_message_str[CMN_LOG_FAILED_OP]); + dbg("%s: timer_create \n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -107,27 +107,27 @@ static int test_timer_initialize(unsigned long arg) ret_chk = timer_delete(timer_id); if (ret_chk == ERROR) { - dbg("timer_delete failed."); + dbg("%s: timer_delete\n", clog_message_str[CMN_LOG_FAILED_OP] ); return ERROR; } if (initalloc_cnt != finalalloc_cnt) { - dbg("timer_initialize failed."); + dbg("%s: timer_initialize\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } if (initfree_cnt != finalfree_cnt) { - dbg("timer_initialize failed."); + dbg("%s: timer_initialize\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } if (createalloc_cnt == finalalloc_cnt) { - dbg("timer_initialize failed."); + dbg("%s: timer_initialize\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } if (createfree_cnt == finalfree_cnt) { - dbg("timer_initialize failed."); + dbg("%s: timer_initialize\n", clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } diff --git a/os/drivers/os_api_test/kernel/test_tz.c b/os/drivers/os_api_test/kernel/test_tz.c index 2b95fdc3c9..520d6f5664 100644 --- a/os/drivers/os_api_test/kernel/test_tz.c +++ b/os/drivers/os_api_test/kernel/test_tz.c @@ -82,7 +82,7 @@ int test_tz(void) up_free_secure_context(); if (i == 32) { - dbg("%s\n", clog_message_str[CMN_LOG_PERFORMING_OP]); + dbg("rdp demo call succeed!\n"); return OK; } diff --git a/os/drivers/otp/otpnull.c b/os/drivers/otp/otpnull.c index 2b89242c89..3a83bd4108 100644 --- a/os/drivers/otp/otpnull.c +++ b/os/drivers/otp/otpnull.c @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/os/drivers/pipes/fifo.c b/os/drivers/pipes/fifo.c index ac122fbebb..39c2ad7275 100644 --- a/os/drivers/pipes/fifo.c +++ b/os/drivers/pipes/fifo.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/pipes/pipe.c b/os/drivers/pipes/pipe.c index 5086b82803..fdb7b0bd1e 100644 --- a/os/drivers/pipes/pipe.c +++ b/os/drivers/pipes/pipe.c @@ -59,7 +59,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/prodconfig/prodconfig.c b/os/drivers/prodconfig/prodconfig.c index 1e192305bc..d377d01800 100644 --- a/os/drivers/prodconfig/prodconfig.c +++ b/os/drivers/prodconfig/prodconfig.c @@ -19,7 +19,6 @@ * Included Files ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/seclink/seclink_drv.c b/os/drivers/seclink/seclink_drv.c index d6e7ba5cb6..4d4fbe07a0 100644 --- a/os/drivers/seclink/seclink_drv.c +++ b/os/drivers/seclink/seclink_drv.c @@ -221,7 +221,7 @@ int se_unregister(FAR struct sec_lowerhalf_s *lower) } if (!upper->path) { - dbg("%s\n"), clog_message_str[CMN_LOG_NULL_CHECK_FAIL]; + dbg("%s\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); assert(0); } diff --git a/os/drivers/seclink/seclink_drv_common.c b/os/drivers/seclink/seclink_drv_common.c index ed9e66130f..0914810587 100644 --- a/os/drivers/seclink/seclink_drv_common.c +++ b/os/drivers/seclink/seclink_drv_common.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/seclink/seclink_drv_crypto.c b/os/drivers/seclink/seclink_drv_crypto.c index 2f6eae8235..ee0ddc793f 100644 --- a/os/drivers/seclink/seclink_drv_crypto.c +++ b/os/drivers/seclink/seclink_drv_crypto.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/seclink/seclink_drv_key.c b/os/drivers/seclink/seclink_drv_key.c index 1ea24cc908..2411587ca0 100644 --- a/os/drivers/seclink/seclink_drv_key.c +++ b/os/drivers/seclink/seclink_drv_key.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/seclink/seclink_drv_ss.c b/os/drivers/seclink/seclink_drv_ss.c index 78e8ebabee..7ae4ad0711 100644 --- a/os/drivers/seclink/seclink_drv_ss.c +++ b/os/drivers/seclink/seclink_drv_ss.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/seclink/seclink_drv_utils.c b/os/drivers/seclink/seclink_drv_utils.c index 9fbddf035c..66f568e224 100644 --- a/os/drivers/seclink/seclink_drv_utils.c +++ b/os/drivers/seclink/seclink_drv_utils.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include #include "seclink_drv_utils.h" diff --git a/os/drivers/serial/lowconsole.c b/os/drivers/serial/lowconsole.c index 13db75fe21..99b7a272ad 100644 --- a/os/drivers/serial/lowconsole.c +++ b/os/drivers/serial/lowconsole.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/serial/serial.c b/os/drivers/serial/serial.c index f16ff9479b..a03d47dddb 100644 --- a/os/drivers/serial/serial.c +++ b/os/drivers/serial/serial.c @@ -55,7 +55,6 @@ ************************************************************************************/ #include -#include #include #include diff --git a/os/drivers/serial/serialirq.c b/os/drivers/serial/serialirq.c index 47c7c65d03..7189728d5e 100644 --- a/os/drivers/serial/serialirq.c +++ b/os/drivers/serial/serialirq.c @@ -55,7 +55,6 @@ ************************************************************************************/ #include -#include #include #include diff --git a/os/drivers/serial/uart_16550.c b/os/drivers/serial/uart_16550.c index 677027eea2..ed177fc622 100644 --- a/os/drivers/serial/uart_16550.c +++ b/os/drivers/serial/uart_16550.c @@ -56,7 +56,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/spi/spi_uio.c b/os/drivers/spi/spi_uio.c index db937a7d83..0ed8e4b05b 100644 --- a/os/drivers/spi/spi_uio.c +++ b/os/drivers/spi/spi_uio.c @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/syslog/ramlog.c b/os/drivers/syslog/ramlog.c index 10aed871a7..943e9ab58b 100644 --- a/os/drivers/syslog/ramlog.c +++ b/os/drivers/syslog/ramlog.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/syslog/syslog_console.c b/os/drivers/syslog/syslog_console.c index df4c97d0fb..d400c76178 100644 --- a/os/drivers/syslog/syslog_console.c +++ b/os/drivers/syslog/syslog_console.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/task_manager/task_manager_drv.c b/os/drivers/task_manager/task_manager_drv.c index 9a2afe2e18..8db9b21fc0 100644 --- a/os/drivers/task_manager/task_manager_drv.c +++ b/os/drivers/task_manager/task_manager_drv.c @@ -115,7 +115,7 @@ static struct task_group_s *taskmgr_get_group_struct(pid_t pid) static int taskmgr_group_bind(struct task_group_s *parent_group, struct pthread_tcb_s *child_tcb) { if (parent_group == NULL || child_tcb == NULL) { - tmdbg("%s [TM] parameter! %s Group bind\n", clog_message_str[CMN_LOG_INVALID_VAL], clog_message_str[CMN_LOG_FAILED_OP]); + tmdbg("%s [TM] parameter! %s Group bind\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL], clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } @@ -157,7 +157,7 @@ static int taskmgr_pthread_ppid_change(pid_t parent_pid, pid_t child_pid) ptcb = (struct pthread_tcb_s *)sched_gettcb(child_pid); if (ptcb == NULL) { - tmdbg("%s [TM] pthread tcb. %s Pthread ppid change\n", clog_message_str[CMN_LOG_INVALID_VAL], clog_message_str[CMN_LOG_FAILED_OP]); + tmdbg("%s ptcb. %s Pthread ppid change\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL], clog_message_str[CMN_LOG_FAILED_OP]); return ERROR; } @@ -194,7 +194,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) data = (tm_drv_data_t *)arg; if (data == NULL) { - tmdbg("%s Argument.\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s data\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } @@ -210,7 +210,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case TMIOC_PAUSE: tcb = sched_gettcb(data->pid); if (tcb == NULL) { - tmdbg("%s pid\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s pid\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } if (tcb->task_state == TSTATE_WAIT_SIG && tcb->waitdog != NULL) { @@ -226,7 +226,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case TMIOC_UNICAST: tcb = sched_gettcb(data->pid); if (tcb == NULL) { - tmdbg("%s pid\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s pid\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } ret = (int)sig_is_handler_registered(tcb, SIGTM_UNICAST); @@ -240,7 +240,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case TMIOC_BROADCAST: tcb = sched_gettcb(data->pid); if (tcb == NULL) { - tmdbg("%s pid\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s pid\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } ret = (int)sig_is_handler_registered(tcb, SIGTM_BROADCAST); @@ -254,7 +254,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case TMIOC_CHECK_ALIVE: tcb = sched_gettcb(data->pid); if (tcb == NULL) { - tmdbg("%s pid\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s pid\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } ret = OK; @@ -262,7 +262,7 @@ static int taskmgr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case TMIOC_TERMINATE: tcb = sched_gettcb(data->pid); if (tcb == NULL) { - tmdbg("%s pid\n", clog_message_str[CMN_LOG_INVALID_VAL]); + tmdbg("%s pid\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return ERROR; } if ((tcb->flags & TCB_FLAG_TTYPE_MASK) >> TCB_FLAG_TTYPE_SHIFT == TCB_FLAG_TTYPE_TASK) { diff --git a/os/drivers/ttrace/ttrace.c b/os/drivers/ttrace/ttrace.c index 2bd4958992..53d9357ef9 100644 --- a/os/drivers/ttrace/ttrace.c +++ b/os/drivers/ttrace/ttrace.c @@ -233,7 +233,7 @@ static int ttrace_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ttdbg("Trace buffer size should be defined by menuconfig.\r\n"); break; default: - ttdbg("%s commands, cmd: %c, arg: %d\r\n", clog_message_str[CMN_LOG_INVALID_VAL], cmd, arg); + ttdbg("%s cmd: %c, arg: %d\r\n", clog_message_str[CMN_LOG_INVALID_VAL], cmd, arg); break; } diff --git a/os/drivers/usbdev/cdcacm.c b/os/drivers/usbdev/cdcacm.c index ac11cf757b..9041fc063a 100644 --- a/os/drivers/usbdev/cdcacm.c +++ b/os/drivers/usbdev/cdcacm.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/cdcacm_desc.c b/os/drivers/usbdev/cdcacm_desc.c index 498a863344..ce054b28d8 100644 --- a/os/drivers/usbdev/cdcacm_desc.c +++ b/os/drivers/usbdev/cdcacm_desc.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/composite.c b/os/drivers/usbdev/composite.c index c014798240..c15af90537 100644 --- a/os/drivers/usbdev/composite.c +++ b/os/drivers/usbdev/composite.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/composite_desc.c b/os/drivers/usbdev/composite_desc.c index 7eb50dd80b..a68d023cbd 100644 --- a/os/drivers/usbdev/composite_desc.c +++ b/os/drivers/usbdev/composite_desc.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include diff --git a/os/drivers/usbdev/pl2303.c b/os/drivers/usbdev/pl2303.c index 963179f9cd..6bbe9c6625 100644 --- a/os/drivers/usbdev/pl2303.c +++ b/os/drivers/usbdev/pl2303.c @@ -57,7 +57,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/usbdev_strings.c b/os/drivers/usbdev/usbdev_strings.c index a61ed450f6..7fe8a3337c 100644 --- a/os/drivers/usbdev/usbdev_strings.c +++ b/os/drivers/usbdev/usbdev_strings.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include diff --git a/os/drivers/usbdev/usbdev_trace.c b/os/drivers/usbdev/usbdev_trace.c index be9a8afb9d..3b9942ebf4 100644 --- a/os/drivers/usbdev/usbdev_trace.c +++ b/os/drivers/usbdev/usbdev_trace.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/usbdev_trprintf.c b/os/drivers/usbdev/usbdev_trprintf.c index f0332fa4fd..fda53274ae 100644 --- a/os/drivers/usbdev/usbdev_trprintf.c +++ b/os/drivers/usbdev/usbdev_trprintf.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/usbmsc.c b/os/drivers/usbdev/usbmsc.c index 679d9d8726..c9290f749a 100644 --- a/os/drivers/usbdev/usbmsc.c +++ b/os/drivers/usbdev/usbmsc.c @@ -76,7 +76,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/usbmsc_desc.c b/os/drivers/usbdev/usbmsc_desc.c index a60ae5d6cc..68d17d9936 100644 --- a/os/drivers/usbdev/usbmsc_desc.c +++ b/os/drivers/usbdev/usbmsc_desc.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbdev/usbmsc_scsi.c b/os/drivers/usbdev/usbmsc_scsi.c index 92f9e8b916..ad356cf089 100644 --- a/os/drivers/usbdev/usbmsc_scsi.c +++ b/os/drivers/usbdev/usbmsc_scsi.c @@ -73,7 +73,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbhost/usbhost_findclass.c b/os/drivers/usbhost/usbhost_findclass.c index acfe35e519..c3cdd3245f 100644 --- a/os/drivers/usbhost/usbhost_findclass.c +++ b/os/drivers/usbhost/usbhost_findclass.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbhost/usbhost_registerclass.c b/os/drivers/usbhost/usbhost_registerclass.c index 5781e90308..e65123f4d5 100644 --- a/os/drivers/usbhost/usbhost_registerclass.c +++ b/os/drivers/usbhost/usbhost_registerclass.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbhost/usbhost_registry.c b/os/drivers/usbhost/usbhost_registry.c index 57f4495260..e5597a0ef5 100644 --- a/os/drivers/usbhost/usbhost_registry.c +++ b/os/drivers/usbhost/usbhost_registry.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include diff --git a/os/drivers/usbhost/usbhost_trace.c b/os/drivers/usbhost/usbhost_trace.c index dfb2c666c0..a8d50dc221 100644 --- a/os/drivers/usbhost/usbhost_trace.c +++ b/os/drivers/usbhost/usbhost_trace.c @@ -55,7 +55,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/usbhost/uvc/usbhost_uvc_ctrl.c b/os/drivers/usbhost/uvc/usbhost_uvc_ctrl.c index 10fdfb8032..e09d2fcca1 100644 --- a/os/drivers/usbhost/uvc/usbhost_uvc_ctrl.c +++ b/os/drivers/usbhost/uvc/usbhost_uvc_ctrl.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/usbhost/uvc/usbhost_uvc_driver.c b/os/drivers/usbhost/uvc/usbhost_uvc_driver.c index d73bee9412..ecf181ff16 100644 --- a/os/drivers/usbhost/uvc/usbhost_uvc_driver.c +++ b/os/drivers/usbhost/uvc/usbhost_uvc_driver.c @@ -1158,7 +1158,7 @@ int uvc_parse_vs_descriptor(FAR uvc_state_t *dev, const unsigned char *buffer, i /* Get the current stream and add the format to it */ streaming = queue_entry(dev->streams.head, struct uvc_streaming, list); if (streaming == NULL) { - uvdbg("%s\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); + uvdbg("%s stream\n", clog_message_str[CMN_LOG_INVALID_VAL]); return -EINVAL; } @@ -1240,7 +1240,7 @@ int uvc_parse_vs_descriptor(FAR uvc_state_t *dev, const unsigned char *buffer, i format = queue_entry(streaming->formats.head, struct uvc_format, list); if (format == NULL) { - uvdbg("%s\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); + uvdbg("%s format\n", clog_message_str[CMN_LOG_NULL_CHECK_FAIL]); return -EINVAL; } format->colorspace = uvc_get_colorspace(buffer[3]); @@ -1704,7 +1704,7 @@ static inline int usbhost_uvc_devinit(FAR struct usbhost_uvc_state_s *priv) /* Set aside a transfer buffer for exclusive use by the driver */ ret = usbhost_alloc_buffers(priv); if (ret < 0) { - udbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); + udbg("%s: usbhost_alloc_buffers\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout; } @@ -1723,19 +1723,19 @@ static inline int usbhost_uvc_devinit(FAR struct usbhost_uvc_state_s *priv) /* Scan the device for video chains. */ ret = uvc_scan_device(priv); if (ret < 0) { - udbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); + udbg("%s: uvc_ctrl_init_device\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout; } ret = uvc_scan_stream(priv); if (ret < 0) { - udbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); + udbg("%s: uvc_scan_stream\n", clog_message_str[CMN_LOG_FAILED_OP]); } /* Register the Camera terminal to this device */ ret = uvc_register_camera(priv); if (ret < 0) { - udbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); + udbg("%s: uvc_register_camera\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout; } @@ -1970,7 +1970,7 @@ static int usbhost_uvc_connect(FAR struct usbhost_class_s *usbclass, FAR const u ret = usbhost_uvc_devinit(priv); if (ret < 0) { - uvdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + uvdbg("%s: usbhost_uvc_devinit, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout; } } @@ -2086,7 +2086,7 @@ static int usbhost_uvc_ctrl_req(void *arg, uint8_t type, uint8_t req, uint16_t w ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, buf); } if (ret < 0) { - udbg("F%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + udbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } /* On success return the length requested */ diff --git a/os/drivers/video/fb.c b/os/drivers/video/fb.c index c00f78ba1b..9e2e831d79 100644 --- a/os/drivers/video/fb.c +++ b/os/drivers/video/fb.c @@ -578,7 +578,7 @@ int fb_register(int display, int plane) ret = up_fbinitialize(display); if (ret < 0) { - gdbg("%s up_fbinitialize() failed for display %d: %d\n", clog_message_str[CMN_LOG_FAILED_OP], display, ret); + gdbg("%s of up_fbinitialize() display %d: %d\n", clog_message_str[CMN_LOG_FAILED_OP], display, ret); goto errout_with_fb; } @@ -596,7 +596,7 @@ int fb_register(int display, int plane) DEBUGASSERT(fb->vtable->getvideoinfo != NULL); ret = fb->vtable->getvideoinfo(fb->vtable, &vinfo); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + gdbg("%s: getvideoinfo() %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_fb; } @@ -606,7 +606,7 @@ int fb_register(int display, int plane) DEBUGASSERT(fb->vtable->getplaneinfo != NULL); ret = fb->vtable->getplaneinfo(fb->vtable, plane, &pinfo); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + gdbg("%s getplaneinfo() %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_fb; } @@ -624,7 +624,7 @@ int fb_register(int display, int plane) DEBUGASSERT(fb->vtable->getoverlayinfo != NULL); ret = fb->vtable->getoverlayinfo(fb->vtable, 0, &oinfo); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + gdbg("%s getoverlayinfo() %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_fb; } @@ -645,7 +645,7 @@ int fb_register(int display, int plane) ret = register_driver(devname, &fb_fops, 0666, (FAR void *)fb); if (ret < 0) { - gdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + gdbg("%s: register_driver() %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_fb; } diff --git a/os/drivers/wireless/realtek/wifi_util_interface/rtk_drv.c b/os/drivers/wireless/realtek/wifi_util_interface/rtk_drv.c index face6ec913..8d3098110f 100644 --- a/os/drivers/wireless/realtek/wifi_util_interface/rtk_drv.c +++ b/os/drivers/wireless/realtek/wifi_util_interface/rtk_drv.c @@ -20,7 +20,6 @@ * Included Files ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/wireless/realtek/wifi_util_interface/rtk_lwip_netconf.c b/os/drivers/wireless/realtek/wifi_util_interface/rtk_lwip_netconf.c index 1b73604fe9..0d8725073a 100644 --- a/os/drivers/wireless/realtek/wifi_util_interface/rtk_lwip_netconf.c +++ b/os/drivers/wireless/realtek/wifi_util_interface/rtk_lwip_netconf.c @@ -16,7 +16,6 @@ /* Includes ------------------------------------------------------------------*/ #include -#include #include #include diff --git a/os/drivers/wireless/realtek/wifi_util_interface/wifi_interactive_mode.c b/os/drivers/wireless/realtek/wifi_util_interface/wifi_interactive_mode.c index 339be9983c..f32fa49e1c 100644 --- a/os/drivers/wireless/realtek/wifi_util_interface/wifi_interactive_mode.c +++ b/os/drivers/wireless/realtek/wifi_util_interface/wifi_interactive_mode.c @@ -15,7 +15,6 @@ ******************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/wireless/scsc/dev.c b/os/drivers/wireless/scsc/dev.c index 78ef1f0066..5004c0779a 100644 --- a/os/drivers/wireless/scsc/dev.c +++ b/os/drivers/wireless/scsc/dev.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include "dev.h" #include "hip.h" diff --git a/os/drivers/wireless/scsc/hip.c b/os/drivers/wireless/scsc/hip.c index cd83af875e..fd872f0de6 100644 --- a/os/drivers/wireless/scsc/hip.c +++ b/os/drivers/wireless/scsc/hip.c @@ -22,7 +22,6 @@ #include "sap.h" #include "utils_scsc.h" #include -#include #include #include diff --git a/os/drivers/wireless/scsc/misc/platform_mif.c b/os/drivers/wireless/scsc/misc/platform_mif.c index 011a46c602..1d7bd6344e 100644 --- a/os/drivers/wireless/scsc/misc/platform_mif.c +++ b/os/drivers/wireless/scsc/misc/platform_mif.c @@ -17,7 +17,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/wireless/scsc/netif.c b/os/drivers/wireless/scsc/netif.c index 391b30df4a..6c07198289 100644 --- a/os/drivers/wireless/scsc/netif.c +++ b/os/drivers/wireless/scsc/netif.c @@ -16,7 +16,6 @@ * ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/wireless/scsc/udi.c b/os/drivers/wireless/scsc/udi.c index c1454274f4..0a258da6fa 100644 --- a/os/drivers/wireless/scsc/udi.c +++ b/os/drivers/wireless/scsc/udi.c @@ -17,7 +17,6 @@ ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/wireless/virtual/vdev.c b/os/drivers/wireless/virtual/vdev.c index 80464489cc..7d15096560 100644 --- a/os/drivers/wireless/virtual/vdev.c +++ b/os/drivers/wireless/virtual/vdev.c @@ -20,7 +20,6 @@ * Included Files ****************************************************************************/ #include -#include #include #include diff --git a/os/drivers/wireless/virtual/vdev_handler.c b/os/drivers/wireless/virtual/vdev_handler.c index 108e2d89a7..afba0876d1 100644 --- a/os/drivers/wireless/virtual/vdev_handler.c +++ b/os/drivers/wireless/virtual/vdev_handler.c @@ -21,7 +21,6 @@ ****************************************************************************/ #include #include -#include #include #include #include diff --git a/os/drivers/wireless/virtual/vdev_ops_handler.c b/os/drivers/wireless/virtual/vdev_ops_handler.c index 9185484850..677c20b84a 100644 --- a/os/drivers/wireless/virtual/vdev_ops_handler.c +++ b/os/drivers/wireless/virtual/vdev_ops_handler.c @@ -20,7 +20,6 @@ * Included Files ****************************************************************************/ #include -#include #include #include #include diff --git a/os/drivers/wireless/virtual/vdev_packet.c b/os/drivers/wireless/virtual/vdev_packet.c index f981aead4f..559b0c49b9 100644 --- a/os/drivers/wireless/virtual/vdev_packet.c +++ b/os/drivers/wireless/virtual/vdev_packet.c @@ -20,7 +20,6 @@ * Included Files ****************************************************************************/ #include -#include #include #include #include diff --git a/os/fs/driver/block/fs_blockproxy.c b/os/fs/driver/block/fs_blockproxy.c index 8ac69f1eef..6d9ecce212 100644 --- a/os/fs/driver/block/fs_blockproxy.c +++ b/os/fs/driver/block/fs_blockproxy.c @@ -178,7 +178,7 @@ int block_proxy(FAR const char *blkdev, int oflags) /* Create a unique temporary file name for the character device */ chardev = unique_chardev(); if (chardev == NULL) { - fdbg("%s #1 \n", clog_message_str[CMN_LOG_FAILED_OP]); + fdbg("%s: unique_chardev()\n", clog_message_str[CMN_LOG_FAILED_OP]); return -ENOMEM; } @@ -188,7 +188,7 @@ int block_proxy(FAR const char *blkdev, int oflags) /* Wrap the block driver with an instance of the BCH driver */ ret = bchdev_register(blkdev, chardev, readonly); if (ret < 0) { - fdbg("%s #2(%s, %s): %d\n", clog_message_str[CMN_LOG_FAILED_OP], + fdbg("%s: bchdev_register(%s, %s): %d\n", clog_message_str[CMN_LOG_FAILED_OP], blkdev, chardev, ret); goto errout_with_chardev; @@ -199,7 +199,7 @@ int block_proxy(FAR const char *blkdev, int oflags) fd = open(chardev, oflags); if (fd < 0) { ret = -errno; - fdbg("%s %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP], chardev, ret); + fdbg("%s: %s, %d\n", clog_message_str[CMN_LOG_FAILED_OP], chardev, ret); goto errout_with_bchdev; } @@ -211,7 +211,7 @@ int block_proxy(FAR const char *blkdev, int oflags) ret = unlink(chardev); if (ret < 0) { ret = -errno; - fdbg("%s #3 %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP], chardev, ret); + fdbg("%s to unlink %s: %d\n", clog_message_str[CMN_LOG_FAILED_OP], chardev, ret); } /* diff --git a/os/fs/driver/mtd/rammtd/rammtd.c b/os/fs/driver/mtd/rammtd/rammtd.c index bfbe467b19..969e57af4b 100644 --- a/os/fs/driver/mtd/rammtd/rammtd.c +++ b/os/fs/driver/mtd/rammtd/rammtd.c @@ -447,7 +447,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size) nblocks = size / CONFIG_RAMMTD_ERASESIZE; if (nblocks < 1) { /*Need to provide at least one full erase block*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s erase block\n", clog_message_str[CMN_LOG_INVALID_VAL]); return NULL; } diff --git a/os/fs/driver/mtd/smart.c b/os/fs/driver/mtd/smart.c index 77651cb678..3db06628ec 100644 --- a/os/fs/driver/mtd/smart.c +++ b/os/fs/driver/mtd/smart.c @@ -1217,7 +1217,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) allocsize = dev->neraseblocks << 1; dev->sMap = (FAR uint16_t *)smart_malloc(dev, totalsectors * sizeof(uint16_t) + allocsize, "Sector map"); if (!dev->sMap) { - fdbg("%s #1\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s SMART virtual map buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -1226,7 +1226,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) #else dev->sBitMap = (FAR uint8_t *)smart_malloc(dev, (totalsectors + 7) >> 3, "Sector Bitmap"); if (dev->sBitMap == NULL) { - fdbg("%s #2\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s SMART sector cache\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -1252,7 +1252,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) } if (!dev->sCache) { - fdbg("%s #3\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s SMART sector cache\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -1281,7 +1281,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) } if (!dev->erasecounts) { - fdbg("%s #4\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s erase count array\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -1293,7 +1293,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) dev->wearstatus = (FAR uint8_t *)smart_malloc(dev, dev->neraseblocks >> SMART_WEAR_BIT_DIVIDE, "Wear status"); if (!dev->wearstatus) { - fdbg("%s #5\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s wear level status array\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -1306,13 +1306,13 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) dev->rwbuffer = (FAR char *)smart_malloc(dev, size, "RW Buffer"); if (!dev->rwbuffer) { - fdbg("%s #6\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s SMART read/write buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } dev->bytebuffer = (FAR uint8_t *)smart_malloc(dev, size, "Byte Buffer"); if (!dev->bytebuffer) { - fdbg("%s #7\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s SMART bytebuffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errexit; } @@ -2266,7 +2266,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) readaddress = sector * dev->mtdBlksPerSector * dev->geo.blocksize; ret = MTD_READ(dev->mtd, readaddress, SMART_WEAR_LEVEL_FORMAT_SIG + 1, (uint8_t *)dev->rwbuffer); if (ret != SMART_WEAR_LEVEL_FORMAT_SIG + 1) { - fdbg("%s sector %d.\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], sector); + fdbg("%s: read physical sector %d.\n", clog_message_str[CMN_LOG_FAILED_OP], sector); goto err_out; } @@ -4637,7 +4637,7 @@ static int smart_allocsector(FAR struct smart_struct_s *dev, unsigned long reque * rescan and try again to "self heal" in case of a * bug in our code? */ - fdbg("%s Free sectors = %d\n", clog_message_str[CMN_LOG_OUT_OF_MEMORY], dev->freesectors); + fdbg("%s Free sectors = %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], dev->freesectors); return -EIO; } diff --git a/os/fs/procfs/fs_procfs.c b/os/fs/procfs/fs_procfs.c index 257c9f0bbd..8ca195bda8 100644 --- a/os/fs/procfs/fs_procfs.c +++ b/os/fs/procfs/fs_procfs.c @@ -481,8 +481,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FA kmm_zalloc(sizeof(struct procfs_level0_s)); if (!level0) { - /*ERROR: Failed to allocate the level0 directory structure*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s level0 directory structure\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -554,8 +553,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FA kmm_zalloc(sizeof(struct procfs_level1_s)); if (!level1) { - /*ERROR: Failed to allocate the level0 directory structure*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s level0 directory\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfscm.c b/os/fs/procfs/fs_procfscm.c index 0f6058de80..ff6c37ae74 100644 --- a/os/fs/procfs/fs_procfscm.c +++ b/os/fs/procfs/fs_procfscm.c @@ -401,8 +401,7 @@ static int cm_open(FAR struct file *filep, FAR const char *relpath, int oflags, */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*ERROR: Only O_RDONLY supported*/ - fdbg("%s\n",clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n",clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -422,8 +421,7 @@ static int cm_open(FAR struct file *filep, FAR const char *relpath, int oflags, /* Allocate a container to hold the domain selection */ connectivityfile = (FAR struct cm_file_s *)kmm_zalloc(sizeof(struct cm_file_s)); if (!connectivityfile) { - /*ERROR: Failed to allocate file container*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s file container\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -527,7 +525,6 @@ static int cm_dup(FAR const struct file *oldp, FAR struct file *newp) newfile = (FAR struct cm_file_s *)kmm_malloc(sizeof(struct cm_file_s)); if (!newfile) { - /*Failed to allocate file container*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -572,7 +569,6 @@ static int cm_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) connectivitydir = (FAR struct cm_dir_s *)kmm_zalloc(sizeof(struct cm_dir_s)); if (!connectivitydir) { - /*Failed to allocate the directory structure*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfscpuload.c b/os/fs/procfs/fs_procfscpuload.c index 8e465c010c..ad670b7482 100644 --- a/os/fs/procfs/fs_procfscpuload.c +++ b/os/fs/procfs/fs_procfscpuload.c @@ -167,8 +167,7 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath, int ofl */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -183,7 +182,6 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath, int ofl attr = (FAR struct cpuload_file_s *)kmm_zalloc(sizeof(struct cpuload_file_s)); if (!attr) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -324,7 +322,6 @@ static int cpuload_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct cpuload_file_s *)kmm_malloc(sizeof(struct cpuload_file_s)); if (!newattr) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfsereport.c b/os/fs/procfs/fs_procfsereport.c index 6435f0eaec..7cc2361f2c 100644 --- a/os/fs/procfs/fs_procfsereport.c +++ b/os/fs/procfs/fs_procfsereport.c @@ -274,8 +274,7 @@ static int ereport_open(FAR struct file *filep, FAR const char *relpath, int ofl */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -295,7 +294,6 @@ static int ereport_open(FAR struct file *filep, FAR const char *relpath, int ofl /* Allocate a container to hold the domain selection */ efile = (FAR struct ereport_file_s *)kmm_zalloc(sizeof(struct ereport_file_s)); if (!efile) { - /*Failed to allocate file container*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -395,7 +393,6 @@ static int ereport_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) ereport_dir = (FAR struct ereport_dir_s *)kmm_zalloc(sizeof(struct ereport_dir_s)); if (!ereport_dir) { - /*Failed to allocate the directory structure*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfsproc.c b/os/fs/procfs/fs_procfsproc.c index 3c52fdb0f5..77e4fe72ff 100644 --- a/os/fs/procfs/fs_procfsproc.c +++ b/os/fs/procfs/fs_procfsproc.c @@ -1019,13 +1019,12 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, int oflags */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } /* The first segment of the relative path should be a task/thread ID */ - + ptr = NULL; tmp = strtoul(relpath, &ptr, 10); @@ -1081,7 +1080,6 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, int oflags procfile = (FAR struct proc_file_s *)kmm_zalloc(sizeof(struct proc_file_s)); if (!procfile) { - /*Failed to allocate file container*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -1301,7 +1299,6 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) procdir = (FAR struct proc_dir_s *)kmm_zalloc(sizeof(struct proc_dir_s)); if (!procdir) { - /*Failed to allocate the directory structure*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfsuptime.c b/os/fs/procfs/fs_procfsuptime.c index 957a8c5739..7e18b14856 100644 --- a/os/fs/procfs/fs_procfsuptime.c +++ b/os/fs/procfs/fs_procfsuptime.c @@ -166,8 +166,7 @@ static int uptime_open(FAR struct file *filep, FAR const char *relpath, int ofla */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -332,7 +331,6 @@ static int uptime_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct uptime_file_s *)kmm_malloc(sizeof(struct uptime_file_s)); if (!newattr) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_procfsversion.c b/os/fs/procfs/fs_procfsversion.c index b1e64e4865..97a06cc196 100644 --- a/os/fs/procfs/fs_procfsversion.c +++ b/os/fs/procfs/fs_procfsversion.c @@ -163,8 +163,7 @@ static int version_open(FAR struct file *filep, FAR const char *relpath, int ofl */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -179,7 +178,6 @@ static int version_open(FAR struct file *filep, FAR const char *relpath, int ofl attr = (FAR struct version_file_s *)kmm_zalloc(sizeof(struct version_file_s)); if (!attr) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -299,7 +297,6 @@ static int version_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct version_file_s *)kmm_malloc(sizeof(struct version_file_s)); if (!newattr) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/procfs/fs_skeleton.c b/os/fs/procfs/fs_skeleton.c index 4b074dde64..68f258832b 100644 --- a/os/fs/procfs/fs_skeleton.c +++ b/os/fs/procfs/fs_skeleton.c @@ -182,8 +182,7 @@ static int skel_open(FAR struct file *filep, FAR const char *relpath, int oflags */ if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && (skel_procfsoperations.write == NULL)) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -191,7 +190,6 @@ static int skel_open(FAR struct file *filep, FAR const char *relpath, int oflags priv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s)); if (!priv) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -277,7 +275,6 @@ static int skel_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s)); if (!newpriv) { - /*Failed to allocate file attribute*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -315,8 +312,7 @@ static int skel_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) kmm_zalloc(sizeof(struct skel_level1_s)); if (!level1) { - /*Failed to allocate the level1 directory structure*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s level1 directory structure\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/romfs/fs_romfs.c b/os/fs/romfs/fs_romfs.c index 65bdbf923f..7d07f0a3c7 100644 --- a/os/fs/romfs/fs_romfs.c +++ b/os/fs/romfs/fs_romfs.c @@ -185,7 +185,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, int oflag romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("#1 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -207,7 +207,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, int oflag ret = romfs_finddirentry(rm, &dirinfo, relpath); if (ret < 0) { - fdbg("#2 %s for '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP], ,relpath, ret); + fdbg("%s to find directory directory entry for '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP],relpath, ret); goto errout_with_semaphore; } @@ -260,7 +260,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, int oflag ret = romfs_datastart(rm, dirinfo.rd_dir.fr_curroffset, &rf->rf_startoffset); if (ret < 0) { - fdbg("#3 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s to locate start of file data %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -268,7 +268,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, int oflag ret = romfs_fileconfigure(rm, rf); if (ret < 0) { - fdbg("#4 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s configure buffering %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -376,7 +376,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, size_t bufle romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("#1 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -421,7 +421,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, size_t bufle fvdbg("Read %d sectors starting with %d\n", nsectors, sector); ret = romfs_hwread(rm, userbuffer, sector, nsectors); if (ret < 0) { - fdbg("#2 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_hwread %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -436,7 +436,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, size_t bufle fvdbg("Read sector %d\n", sector); ret = romfs_filecacheread(rm, rf, sector); if (ret < 0) { - fdbg("#3 %s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_filecacheread %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -526,7 +526,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -617,7 +617,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp) romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -644,9 +644,8 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp) /* Configure buffering to support access to this file */ ret = romfs_fileconfigure(rm, newrf); - if (ret < 0) { - - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + if (ret < 0) { + fdbg("%s configure buffering %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -748,7 +747,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FAR romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -756,7 +755,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FAR ret = romfs_finddirentry(rm, &dirinfo, relpath); if (ret < 0) { - fdbg("%s #2 '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP], relpath,ret); + fdbg("%s find directory '%s': %d\n", clog_message_str[CMN_LOG_FAILED_OP], relpath,ret); goto errout_with_semaphore; } @@ -812,7 +811,7 @@ static int romfs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -835,7 +834,7 @@ static int romfs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) ret = romfs_parsedirentry(rm, dir->u.romfs.fr_curroffset, &linkoffset, &next, &info, &size); if (ret < 0) { - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_parsedirentry %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -843,7 +842,7 @@ static int romfs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) ret = romfs_parsefilename(rm, dir->u.romfs.fr_curroffset, dir->fd_dir.d_name); if (ret < 0) { - fdbg("%s #3 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_parsefilename %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -935,8 +934,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, FAR voi rm = (FAR struct romfs_mountpt_s *)kmm_zalloc(sizeof(struct romfs_mountpt_s)); if (!rm) { - /*Failed to allocate mountpoint structure*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s mountpoint structure\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -952,7 +950,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, FAR voi ret = romfs_hwconfigure(rm); if (ret < 0) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_hwconfigure %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_sem; } @@ -962,7 +960,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, FAR voi ret = romfs_fsconfigure(rm); if (ret < 0) { - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s romfs_fsconfigure %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_buffer; } @@ -1175,7 +1173,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath, FAR st romfs_semtake(rm); ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s: romfs_checkmount %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -1186,7 +1184,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath, FAR st /* If nothing was found, then we fail with EEXIST */ if (ret < 0) { - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s to find directory: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } diff --git a/os/fs/smartfs/smartfs_mksmartfs.c b/os/fs/smartfs/smartfs_mksmartfs.c index 98e35823f4..cf3aac26ef 100644 --- a/os/fs/smartfs/smartfs_mksmartfs.c +++ b/os/fs/smartfs/smartfs_mksmartfs.c @@ -128,8 +128,7 @@ int mksmartfs(FAR const char *pathname, bool force) /* Make sure that the inode supports the write and geometry methods at a minimum */ if (!inode->u.i_bops->write || !inode->u.i_bops->geometry) { - /*does not support write or geometry methods*/ - fdbg("%s %s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED], pathname); + fdbg("%s to write or geometry methods%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED], pathname); ret = -EACCES; goto errout_with_driver; } @@ -152,16 +151,14 @@ int mksmartfs(FAR const char *pathname, bool force) ret = inode->u.i_bops->ioctl(inode, BIOC_LLFORMAT, 0); #endif if (ret != OK) { - /*Error creating low-level format*/ - fdbg("%s #1 %d\n", clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], ret); + fdbg("%s create low-level format %d\n", clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], ret); goto errout_with_driver; } /* Get the format information so we know how big the sectors are */ ret = inode->u.i_bops->ioctl(inode, BIOC_GETFORMAT, (unsigned long)&fmt); if (ret != OK) { - /*Error getting device low level format*/ - fdbg("%s #2 %d\n", clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], ret); + fdbg("%s to get device low level format %d\n", clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], ret); goto errout_with_driver; } diff --git a/os/fs/smartfs/smartfs_procfs.c b/os/fs/smartfs/smartfs_procfs.c index 28487e992d..5ff767dbc4 100644 --- a/os/fs/smartfs/smartfs_procfs.c +++ b/os/fs/smartfs/smartfs_procfs.c @@ -347,8 +347,7 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath, int ofl * REVISIT: Write-able proc files could be quite useful. */ if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && (!filep->f_inode->u.i_mops->write)) { - /*Only O_RDONLY supported*/ - fdbg("%s\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); + fdbg("%s To write\n", clog_message_str[CMN_LOG_NOT_SUPPORTED]); return -EACCES; } @@ -356,7 +355,6 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath, int ofl priv = (FAR struct smartfs_file_s *)kmm_malloc(sizeof(struct smartfs_file_s)); if (!priv) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -495,7 +493,6 @@ static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct smartfs_file_s *)kmm_malloc(sizeof(struct smartfs_file_s)); if (!newpriv) { - /*Failed to allocate file attributes*/ fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -534,8 +531,7 @@ static int smartfs_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) kmm_malloc(sizeof(struct smartfs_level1_s)); if (!level1) { - /*Failed to allocate the level1 directory structure*/ - fdbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); + fdbg("%s level directory\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/fs/smartfs/smartfs_smart.c b/os/fs/smartfs/smartfs_smart.c index 4d1102bbc3..69d4e6a8c0 100644 --- a/os/fs/smartfs/smartfs_smart.c +++ b/os/fs/smartfs/smartfs_smart.c @@ -251,8 +251,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, int oflags, if ((oflags & O_ACCMODE) != O_RDONLY) { ret = smartfs_get_datalen(fs, sf->entry.firstsector, &sf->entry.datalen); if (ret < 0) { - /*ERROR, Could not get the length of the file*/ - fdbg("%s ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + fdbg("%s length of the file. ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); goto errout_with_buffer; } } @@ -288,8 +287,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, int oflags, /* First we allocate a new data sector for the file */ ret = smartfs_alloc_firstsector(fs, &sf->entry.firstsector, SMARTFS_DIRENT_TYPE_FILE, sf); if (ret != OK) { - /*Unable to allocate data sector for new entry*/ - fdbg("%s #1 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + fdbg("%s allocate data sector, ret : %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL],ret); goto errout_with_buffer; } @@ -297,8 +295,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, int oflags, ret = smartfs_find_availableentry(fs, &sf->entry); if (ret != OK) { /* find_availableentry encountered a problem with lower layer operations, return error */ - /*Unable to find space for writing new entry,*/ - fdbg("%s #2 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); + fdbg("%s find space for writing new entry ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP],ret); goto errout_with_buffer; } @@ -311,7 +308,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, int oflags, /* At this point, either an available entry was found or a new one has been created */ ret = smartfs_writeentry(fs, sf->entry, SMARTFS_DIRENT_TYPE_FILE, mode); if (ret != OK) { - fdbg("%s ret : %d\n", clog_message_str[CMN_LOG_FILE_WRITE_ERROR],ret); + fdbg("%s smartfs_writeentry() ret : %d\n", clog_message_str[CMN_LOG_FILE_WRITE_ERROR],ret); goto errout_with_buffer; } } else { @@ -1486,22 +1483,19 @@ static int smartfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode /* Allocate new data sector for entry */ ret = smartfs_alloc_firstsector(fs, &entry.firstsector, SMARTFS_DIRENT_TYPE_DIR, NULL); if (ret != OK) { - /*Unable to allocate data sector for new entry*/ - fdbg("%s #1 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s: smartfs_alloc_firstsector: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } /* Try to find empty/invalid entry available in one of he chained parent sectors */ ret = smartfs_find_availableentry(fs, &entry); if (ret != OK) { - /*Unable to find space for writing new entry*/ - fdbg("%s #2 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s: smartfs_find_availableentry: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } /* Now we have an entry allocated for writing, write new entry to sector */ ret = smartfs_writeentry(fs, entry, SMARTFS_DIRENT_TYPE_DIR, mode); if (ret != OK) { - /*Unable to write new entry*/ - fdbg("%s #3 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s: smartfs_writeentry: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } } @@ -1663,7 +1657,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, const char *ne ret = smartfs_find_availableentry(fs, &newentry); if (ret != OK) { /*Unable to find space for writing new entry*/ - fdbg("%s #1 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s writing new entry ret : %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], ret); goto errout_with_semaphore; } @@ -1671,7 +1665,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, const char *ne ret = smartfs_writeentry(fs, newentry, type, mode); if (ret != OK) { /*Unable to write new entry*/ - fdbg("%s #2 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s to write new entry ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } @@ -1679,7 +1673,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, const char *ne ret = smartfs_invalidateentry(fs, oldentry.dsector, oldentry.doffset); if (ret != OK) { /*Unable to invalidate old entry*/ - fdbg("%s #3 ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); + fdbg("%s to invalidate old entry ret : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout_with_semaphore; } } else { diff --git a/os/include/tinyara/common_logs/common_logs.h b/os/include/tinyara/common_logs/common_logs.h index 3666a829d9..5e29871c72 100644 --- a/os/include/tinyara/common_logs/common_logs.h +++ b/os/include/tinyara/common_logs/common_logs.h @@ -3,7 +3,6 @@ typedef enum /* Memory Operations */ CMN_LOG_ALLOC_FAIL, CMN_LOG_NULL_CHECK_FAIL, - CMN_LOG_OUT_OF_MEMORY, CMN_LOG_MEM_LEAK, CMN_LOG_BUFFER_OVERFLOW, @@ -37,7 +36,6 @@ typedef enum CMN_LOG_INVALID_DATA, CMN_LOG_VALID_DATA, CMN_LOG_NOT_SUPPORTED, - CMN_LOG_MSG_MAX } CLOG_INDEX; @@ -45,40 +43,39 @@ typedef enum static const char* clog_message_str[CMN_LOG_MSG_MAX] = { /* Memory Operations */ - "Memory allocation failed :", //CMN_LOG_ALLOC_FAIL, - "Null pointer check failed :", //CMN_LOG_NULL_CHECK_FAIL, - "Out of memory :", //CMN_LOG_OUT_OF_MEMORY, - "Potential memory leak :", //CMN_LOG_MEM_LEAK, - "Buffer overflow detected :", //CMN_LOG_BUFFER_OVERFLOW, + "Memory allocation failure", //CMN_LOG_ALLOC_FAIL, + "Null pointer", //CMN_LOG_NULL_CHECK_FAIL, + "Potential memory leak", //CMN_LOG_MEM_LEAK, + "Buffer overflow detection", //CMN_LOG_BUFFER_OVERFLOW, /* File Operations */ - "File not found :", //CMN_LOG_FILE_NFOUND, - "Failed to open file :", //CMN_LOG_FILE_OPEN_ERROR, - "Failed to read from file :", //CMN_LOG_FILE_READ_ERROR, - "Failed to write to file :", //CMN_LOG_FILE_WRITE_ERROR, - "Failed to seek file :", //CMN_LOG_FILE_SEEK_ERROR, - "Failed ioctl call to file :", //CMN_LOG_FILE_IOCTL_ERROR, + "File not found", //CMN_LOG_FILE_NFOUND, + "File open failure", //CMN_LOG_FILE_OPEN_ERROR, + "File read failure", //CMN_LOG_FILE_READ_ERROR, + "File write failure", //CMN_LOG_FILE_WRITE_ERROR, + "File seek failure", //CMN_LOG_FILE_SEEK_ERROR, + "IOCTL call failure", //CMN_LOG_FILE_IOCTL_ERROR, /* Network Operations */ - "Connection Timeout :", //CMN_LOG_CON_TIMEOUT, - "Connection Refused :", //CMN_LOG_CON_REFUSED, - "Data Transmission Error :", //CMN_LOG_DATA_TRANS_ERROR, - "Handshake failed :", //CMN_LOG_HANDSHAKE_FAILED, - "Invalid Certificate :", //CMN_LOG_CERTIFICATE_INVALID, + "Connection Timeout", //CMN_LOG_CON_TIMEOUT, + "Connection Refuse", //CMN_LOG_CON_REFUSED, + "Data Transmission Error", //CMN_LOG_DATA_TRANS_ERROR, + "Handshake failure", //CMN_LOG_HANDSHAKE_FAILED, + "Invalid Certificate ", //CMN_LOG_CERTIFICATE_INVALID, /* Authentication and Authorization */ - "Invalid Credentials :", //CMN_LOG_INVALID_CREDENTIALS, + "Invalid Credentials", //CMN_LOG_INVALID_CREDENTIALS, /* Commonly used logs for printing information */ - "Value of :", //CMN_LOG_VALUE_OF, - "Invalid value of :", //CMN_LOG_INVALID_VAL, - "Failed operation :", //CMN_LOG_FAILED_OP, - "Performing operation :", //CMN_LOG_PERFORMING_OP, - "Init done :", //CMN_LOG_INIT_DONE, - "Deinit done :", //CMN_LOG_DEINIT_DONE, - "Start of :", //CMN_LOG_START, - "End of :", //CMN_LOG_END, - "Invalid data in :", //CMN_LOG_INVALID_DATA - "Valid data in :", //CMN_LOG_VALID_DATA - "Not supported", // CMN_LOG_NOT_SUPPORTED + "Value of", //CMN_LOG_VALUE_OF, + "Invalid value of", //CMN_LOG_INVALID_VAL, + "Operation failure", //CMN_LOG_FAILED_OP, + "Performing operation", //CMN_LOG_PERFORMING_OP, + "Init done", //CMN_LOG_INIT_DONE, + "Deinit done", //CMN_LOG_DEINIT_DONE, + "Start of", //CMN_LOG_START, + "End of", //CMN_LOG_END, + "Invalid data in", //CMN_LOG_INVALID_DATA, + "Valid data in :" //CMN_LOG_VALID_DATA, + "Not supported", // CMN_LOG_NOT_SUPPORTED }; diff --git a/os/kernel/init/os_smpstart.c b/os/kernel/init/os_smpstart.c index df0f74b26c..419819b611 100644 --- a/os/kernel/init/os_smpstart.c +++ b/os/kernel/init/os_smpstart.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include "group/group.h" #include "sched/sched.h" #include "init/init.h" diff --git a/os/kernel/preference/preference_callback.c b/os/kernel/preference/preference_callback.c index a7e8536108..a3eb1b8ad0 100644 --- a/os/kernel/preference/preference_callback.c +++ b/os/kernel/preference/preference_callback.c @@ -31,6 +31,7 @@ #include #include #include +#include struct key_cb_list_s { struct key_cb_list_s *flink; @@ -102,7 +103,7 @@ void preference_send_cb_msg(int type, const char *key) snprintf(q_name, PREFERENCE_CBMQ_LEN, "%s%d", PREFERENCE_CBMSG_MQ, node->pid); send_mq = mq_open(q_name, O_WRONLY | O_CREAT, 0666, &attr); if (send_mq == (mqd_t)ERROR) { - prefdbg("Failed to open mq '%s', errno %d\n", q_name, errno); + prefdbg("%s '%s', errno %d\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], q_name, errno); return; } @@ -112,11 +113,11 @@ void preference_send_cb_msg(int type, const char *key) if (ret == OK) { ret = kill(node->pid, SIG_PREFERENCE); if (ret != OK) { - prefdbg("Failed to send signal, pid %d errno %d\n", node->pid, errno); + prefdbg("%s ,pid %d errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], node->pid, errno); goto errout_with_unlink; } } else { - prefdbg("Failed to send mq %s, errno %d\n", q_name, errno); + prefdbg("%s to send mq %s, errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], q_name, errno); goto errout_with_unlink; } node = (key_cb_node_t *)sq_next(node); @@ -142,7 +143,7 @@ int preference_register_callback(preference_callback_t *data) ret = preference_check_key(data->type, data->key, &result); if (ret < 0) { - prefdbg("Failed to check key, ret %d\n", ret); + prefdbg("%s check_key, ret %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } else if (result == false) { prefdbg("Key %s is not existing\n", data->key); @@ -165,7 +166,7 @@ int preference_register_callback(preference_callback_t *data) node = (key_cb_node_t *)PREFERENCE_ALLOC(sizeof(key_cb_node_t)); if (node == NULL) { - prefdbg("Failed to allocate cb node\n"); + prefdbg("%s cb node\n", clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } node->pid = getpid(); @@ -187,7 +188,7 @@ int preference_unregister_callback(const char *key, int type) ret = preference_check_key(type, key, &result); if (ret < 0) { - prefdbg("Failed to check key, ret %d\n", ret); + prefdbg("%s check_key, ret %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } else if (result == false) { prefdbg("Key %s is not existing\n", key); @@ -196,7 +197,7 @@ int preference_unregister_callback(const char *key, int type) list = preference_get_key_cb_list(type, key); if (list == NULL) { - prefdbg("Callback is not registered for key %s\n", key); + prefdbg("%s get key from cb list %s\n", clog_message_str[CMN_LOG_FAILED_OP], key); return PREFERENCE_NOT_REGISTERED; } diff --git a/os/kernel/preference/preference_check.c b/os/kernel/preference/preference_check.c index 853010943e..a700cb2eca 100644 --- a/os/kernel/preference/preference_check.c +++ b/os/kernel/preference/preference_check.c @@ -24,6 +24,7 @@ #include #include #include +#include /**************************************************************************** * Private Functions @@ -34,7 +35,7 @@ static int preference_check_fs_key(char *path, bool *existing) struct stat st; if (path == NULL) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } @@ -61,20 +62,20 @@ int preference_check_key(int type, const char *key, bool *result) char *path; if (key == NULL || (type != PRIVATE_PREFERENCE && type != SHARED_PREFERENCE)) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n",clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } if (type == PRIVATE_PREFERENCE) { ret = preference_get_private_keypath(key, &path); if (ret < 0) { - prefdbg("Failed to get preference path\n"); + prefdbg("%s get preference path \n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } } else { ret = PREFERENCE_ASPRINTF(&path, "%s/%s", PREF_SHARED_PATH, key); if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s allocate path \n", clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } } diff --git a/os/kernel/preference/preference_common.c b/os/kernel/preference/preference_common.c index 02cc5a3a7e..bd7c1b811c 100644 --- a/os/kernel/preference/preference_common.c +++ b/os/kernel/preference/preference_common.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "sched/sched.h" #endif @@ -40,13 +41,13 @@ int preference_get_private_keypath(const char *key, char **path) /* Get path for app preference */ tcb = this_task(); if (!tcb->group) { - prefdbg("Failed to get group\n"); + prefdbg("%s get group\n", clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OPERATION_FAIL; } /* Assign full path for app preference directory */ ret = PREFERENCE_ASPRINTF(path, "%s/%s/%s", PREF_PRIVATE_PATH, tcb->group->tg_name, key); if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s allocate path\n", clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } prefvdbg("Preference key path = %s\n", *path); diff --git a/os/kernel/preference/preference_read.c b/os/kernel/preference/preference_read.c index db987d9596..796397132e 100644 --- a/os/kernel/preference/preference_read.c +++ b/os/kernel/preference/preference_read.c @@ -24,6 +24,7 @@ #include #include #include +#include /**************************************************************************** * Private Functions @@ -48,15 +49,15 @@ static int preference_read_fs_key(char *path, preference_data_t *data) /* Read and Verify attributes of data : crc, type, len */ ret = read(fd, (FAR uint8_t *)&attr, sizeof(value_attr_t)); if (ret != sizeof(value_attr_t)) { - prefdbg("Failed to read attribute, errno %d\n", errno); + prefdbg("%s, errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], errno); ret = PREFERENCE_IO_ERROR; goto errout; } else if (attr.type < 0 || attr.len < 0) { - prefdbg("Invalid data : type %d, len %d\n", attr.type, attr.len); + prefdbg("%s type %d, len %d\n", clog_message_str[CMN_LOG_INVALID_VAL], attr.type, attr.len); ret = PREFERENCE_OPERATION_FAIL; goto errout; } else if (attr.type != data->attr.type) { - prefdbg("Invalid type. request type:%d, read type:%d\n", data->attr.type, attr.type); + prefdbg("%s request type:%d, read type:%d\n", clog_message_str[CMN_LOG_INVALID_VAL], data->attr.type, attr.type); ret = PREFERENCE_INVALID_PARAMETER; goto errout; } @@ -70,7 +71,7 @@ static int preference_read_fs_key(char *path, preference_data_t *data) /* Read value data */ ret = read(fd, (void *)data->value, data->attr.len); if (ret != data->attr.len) { - prefdbg("Failed to read key value, errno %d\n", errno); + prefdbg("%s, errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], errno); ret = PREFERENCE_IO_ERROR; goto errout_with_free; } @@ -79,7 +80,7 @@ static int preference_read_fs_key(char *path, preference_data_t *data) check_crc = crc32((uint8_t *)&data->attr.type, sizeof(value_attr_t) - sizeof(uint32_t)); check_crc = crc32part((uint8_t *)data->value, data->attr.len, check_crc); if (check_crc != attr.crc) { - prefdbg("Invalid checksum, read crc : %u, calculated crc : %u\n", attr.crc, check_crc); + prefdbg("%s read crc : %u, calculated crc : %u\n", clog_message_str[CMN_LOG_INVALID_VAL], attr.crc, check_crc); ret = PREFERENCE_INVALID_DATA; goto errout_with_free; } @@ -105,20 +106,20 @@ int preference_read_key(preference_data_t *data) char *path; if (data == NULL || data->key == NULL || (data->type != PRIVATE_PREFERENCE && data->type != SHARED_PREFERENCE)) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } if (data->type == PRIVATE_PREFERENCE) { ret = preference_get_private_keypath(data->key, &path); if (ret < 0) { - prefdbg("Failed to get preference path\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } } else { ret = PREFERENCE_ASPRINTF(&path, "%s/%s", PREF_SHARED_PATH, data->key); if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s allocate path\n",clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } } diff --git a/os/kernel/preference/preference_remove.c b/os/kernel/preference/preference_remove.c index 6a90916205..1b250589a6 100644 --- a/os/kernel/preference/preference_remove.c +++ b/os/kernel/preference/preference_remove.c @@ -28,6 +28,7 @@ #if CONFIG_TASK_NAME_SIZE > 0 #include #include +#include #include "sched/sched.h" #endif @@ -40,7 +41,7 @@ static int preference_remove_fs_key(char *path) int ret; if (path == NULL) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } @@ -52,7 +53,7 @@ static int preference_remove_fs_key(char *path) prefdbg("key file is not exist : %s\n", path); } else { ret = PREFERENCE_IO_ERROR; - prefdbg("Failed to remove key file %s\n", path); + prefdbg("%s path :%s\n", clog_message_str[CMN_LOG_FAILED_OP], path); } } else { ret = OK; @@ -72,20 +73,20 @@ int preference_remove_key(int type, const char *key) char *path; if (key == NULL || (type != PRIVATE_PREFERENCE && type != SHARED_PREFERENCE)) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } if (type == PRIVATE_PREFERENCE) { ret = preference_get_private_keypath(key, &path); if (ret < 0) { - prefdbg("Failed to get preference path\n"); + prefdbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } } else { ret = PREFERENCE_ASPRINTF(&path, "%s/%s", PREF_SHARED_PATH, key); if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s allocate path\n",clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } } @@ -105,7 +106,7 @@ int preference_remove_all_key(int type, const char *path) #endif if ((type != PRIVATE_PREFERENCE && type != SHARED_PREFERENCE) || (type == SHARED_PREFERENCE && path == NULL)) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } @@ -113,7 +114,7 @@ int preference_remove_all_key(int type, const char *path) #if CONFIG_TASK_NAME_SIZE > 0 tcb = this_task(); if (!tcb->group) { - prefdbg("Failed to get group\n"); + prefdbg("%s \n",clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OPERATION_FAIL; } @@ -128,7 +129,7 @@ int preference_remove_all_key(int type, const char *path) ret = PREFERENCE_ASPRINTF(&dir_path, "%s/%s", PREF_SHARED_PATH, path); } if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s \n",clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } @@ -136,7 +137,7 @@ int preference_remove_all_key(int type, const char *path) dir = (DIR *)opendir(dir_path); if (!dir) { - prefdbg("Failed to open dir %s, %d\n", dir_path, errno); + prefdbg("%s %s, %d\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], dir_path, errno); if (errno == ENOENT) { ret = PREFERENCE_PATH_NOT_FOUND; } else { @@ -159,7 +160,7 @@ int preference_remove_all_key(int type, const char *path) prefvdbg("Remove key file : %s\n", key_path); ret = preference_remove_fs_key(key_path); if (ret < 0) { - prefdbg("Failed to remove key file %d\n", ret); + prefdbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); break; } } diff --git a/os/kernel/preference/preference_write.c b/os/kernel/preference/preference_write.c index 9736a159c5..0c01b32158 100644 --- a/os/kernel/preference/preference_write.c +++ b/os/kernel/preference/preference_write.c @@ -30,6 +30,7 @@ #include #if CONFIG_TASK_NAME_SIZE > 0 #include +#include #include "sched/sched.h" #endif @@ -46,7 +47,7 @@ static int preference_private_setup(void) tcb = this_task(); if (!tcb->group) { - prefdbg("Failed to get group\n"); + prefdbg("%s \n",clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OPERATION_FAIL; } @@ -57,7 +58,7 @@ static int preference_private_setup(void) ret = mkdir(path, 0777); PREFERENCE_FREE(path); if (ret < 0 && errno != EEXIST) { - prefdbg("mkdir fail, %d\n", errno); + prefdbg("%s, %d\n", clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], errno); return PREFERENCE_IO_ERROR; } @@ -94,7 +95,7 @@ static int preference_shared_setup(char *key_path) prefvdbg("dir path = %s\n", dir_path); ret = mkdir(dir_path, 0777); if (ret < 0 && errno != EEXIST) { - prefdbg("mkdir fail, %d\n", errno); + prefdbg("%s %d\n",clog_message_str[CMN_LOG_FILE_IOCTL_ERROR], errno); PREFERENCE_FREE(dir_path); return PREFERENCE_IO_ERROR; } @@ -114,7 +115,7 @@ static int preference_write_fs_key(char *path, preference_data_t *data) fd = open(path, O_WRONLY | O_CREAT, 0666); if (fd < 0) { - prefdbg("open fail %d\n", errno); + prefdbg("%s error: %d\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], errno); PREFERENCE_FREE(path); return PREFERENCE_IO_ERROR; } @@ -126,14 +127,14 @@ static int preference_write_fs_key(char *path, preference_data_t *data) /* Write attributes of data : crc, type, len */ ret = write(fd, (void *)&data->attr, sizeof(value_attr_t)); if (ret != sizeof(value_attr_t)) { - prefdbg("Failed to write key value, errno %d\n", errno); + prefdbg("%s write key value, errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], errno); goto errout_with_close; } /* Write value data */ ret = write(fd, (void *)data->value, data->attr.len); if (ret != data->attr.len) { - prefdbg("Failed to write key value, errno %d\n", errno); + prefdbg("%s write key value, errno %d\n", clog_message_str[CMN_LOG_FAILED_OP], errno); goto errout_with_close; } @@ -159,7 +160,7 @@ int preference_write_key(preference_data_t *data) char *path; if (data == NULL || data->key == NULL || (data->type != PRIVATE_PREFERENCE && data->type != SHARED_PREFERENCE)) { - prefdbg("Invalid parameter\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_INVALID_VAL]); return PREFERENCE_INVALID_PARAMETER; } @@ -167,12 +168,12 @@ int preference_write_key(preference_data_t *data) #if CONFIG_TASK_NAME_SIZE > 0 ret = preference_private_setup(); if (ret < 0) { - prefdbg("Failed to set up preference\n"); + prefdbg("%s: set up preference\n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } ret = preference_get_private_keypath(data->key, &path); if (ret < 0) { - prefdbg("Failed to get preference path\n"); + prefdbg("%s: get preference path\n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } #else @@ -182,12 +183,12 @@ int preference_write_key(preference_data_t *data) } else { ret = preference_shared_setup(data->key); if (ret < 0) { - prefdbg("Failed to set up preference\n"); + prefdbg("%s preference_shared_setup \n", clog_message_str[CMN_LOG_FAILED_OP]); return ret; } ret = PREFERENCE_ASPRINTF(&path, "%s/%s", PREF_SHARED_PATH, data->key); if (ret < 0) { - prefdbg("Failed to allocate path\n"); + prefdbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); return PREFERENCE_OUT_OF_MEMORY; } } diff --git a/os/mm/kmm_heap/kmm_calloc.c b/os/mm/kmm_heap/kmm_calloc.c index c79b916b80..17e336b443 100644 --- a/os/mm/kmm_heap/kmm_calloc.c +++ b/os/mm/kmm_heap/kmm_calloc.c @@ -57,6 +57,7 @@ #include #include #include +#include #ifdef CONFIG_MM_KERNEL_HEAP @@ -122,7 +123,7 @@ void *kmm_calloc_at(int heap_index, size_t n, size_t elem_size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("kmm_calloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s kmm_calloc_at, Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/kmm_heap/kmm_malloc.c b/os/mm/kmm_heap/kmm_malloc.c index bf11310595..f360bac5ea 100644 --- a/os/mm/kmm_heap/kmm_malloc.c +++ b/os/mm/kmm_heap/kmm_malloc.c @@ -57,6 +57,7 @@ #include #include #include +#include #ifdef CONFIG_MM_KERNEL_HEAP @@ -138,7 +139,7 @@ void *kmm_malloc_at(int heap_index, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("kmm_malloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s kmm_malloc_at, Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/kmm_heap/kmm_memalign.c b/os/mm/kmm_heap/kmm_memalign.c index 4adf015323..4189942b8c 100644 --- a/os/mm/kmm_heap/kmm_memalign.c +++ b/os/mm/kmm_heap/kmm_memalign.c @@ -60,6 +60,7 @@ #include #include +#include #ifdef CONFIG_MM_KERNEL_HEAP @@ -97,7 +98,7 @@ void *kmm_memalign_at(int heap_index, size_t alignment, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("kmm_memalign_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s kmm_memalign_at, Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/kmm_heap/kmm_realloc.c b/os/mm/kmm_heap/kmm_realloc.c index 2d367e6107..aa94818c07 100644 --- a/os/mm/kmm_heap/kmm_realloc.c +++ b/os/mm/kmm_heap/kmm_realloc.c @@ -57,6 +57,7 @@ #include #include #include +#include #ifdef CONFIG_MM_KERNEL_HEAP @@ -94,7 +95,7 @@ void *kmm_realloc_at(int heap_index, void *oldmem, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("kmm_realloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s kmm_realloc_at failed. Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/mm_heap/mm_manage_allocfail.c b/os/mm/mm_heap/mm_manage_allocfail.c index 33c4364a83..0658f2823c 100644 --- a/os/mm/mm_heap/mm_manage_allocfail.c +++ b/os/mm/mm_heap/mm_manage_allocfail.c @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef CONFIG_MM_ASSERT_ON_FAIL #include #ifdef CONFIG_SYSTEM_REBOOT_REASON @@ -95,7 +96,7 @@ void mm_manage_alloc_fail(struct mm_heap_s *heap, int startidx, int endidx, size abort_mode = true; #endif - mfdbg("Allocation failed from %s heap.\n", (heap_type == KERNEL_HEAP) ? KERNEL_STR : USER_STR); + mfdbg("%s from %s heap.\n", clog_message_str[CMN_LOG_ALLOC_FAIL], (heap_type == KERNEL_HEAP) ? KERNEL_STR : USER_STR); mfdbg(" - requested size %u\n", size); #ifdef CONFIG_DEBUG_MM_HEAPINFO mfdbg(" - caller address = 0x%08x\n", caller); diff --git a/os/mm/shm/shm_initialize.c b/os/mm/shm/shm_initialize.c index 0990d683c9..cc81717d4c 100644 --- a/os/mm/shm/shm_initialize.c +++ b/os/mm/shm/shm_initialize.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "shm/shm.h" @@ -151,7 +152,7 @@ int shm_group_initialize(FAR struct task_group_s *group) group->tg_shm.gs_handle = gran_initialize((FAR void *)CONFIG_ARCH_SHM_VBASE, ARCH_SHM_MAXPAGES << MM_PGSHIFT, MM_PGSHIFT, MM_PGSHIFT); if (!group->tg_shm.gs_handle) { - shmdbg("gran_initialize() failed\n"); + shmdbg("%s\n", clog_message_str[CMN_LOG_FAILED_OP]); return -ENOMEM; } diff --git a/os/mm/shm/shmat.c b/os/mm/shm/shmat.c index b1a6ebea6c..90e9c1bce7 100644 --- a/os/mm/shm/shmat.c +++ b/os/mm/shm/shmat.c @@ -62,6 +62,7 @@ #include #include #include +#include #include "shm/shm.h" @@ -167,7 +168,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmdbg("%s sem_wait: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout; } @@ -175,7 +176,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) vaddr = (uintptr_t)gran_alloc(group->tg_shm.gs_handle, region->sr_ds.shm_segsz); if (vaddr == 0) { - shmdbg("gran_alloc() failed\n"); + shmdbg("%s gran_alloc() \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); ret = -ENOMEM; goto errout_with_semaphore; } @@ -188,7 +189,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = up_shmat(region->sr_pages, npages, vaddr); if (ret < 0) { - shmdbg("up_shmat() failed\n"); + shmdbg("%s up_shmat() \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); goto errout_with_vaddr; } diff --git a/os/mm/shm/shmctl.c b/os/mm/shm/shmctl.c index bbefe8fba8..547d89df4c 100644 --- a/os/mm/shm/shmctl.c +++ b/os/mm/shm/shmctl.c @@ -67,6 +67,7 @@ #include #include +#include #include "shm/shm.h" @@ -166,7 +167,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmdbg("%s sem_wait: %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], ret); return ret; } diff --git a/os/mm/shm/shmdt.c b/os/mm/shm/shmdt.c index 4f3dafa219..7d5a7852af 100644 --- a/os/mm/shm/shmdt.c +++ b/os/mm/shm/shmdt.c @@ -62,6 +62,7 @@ #include #include #include +#include #include "shm/shm.h" @@ -149,7 +150,7 @@ int shmdt(FAR const void *shmaddr) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmdbg("%s sem_wait : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); goto errout; } @@ -167,7 +168,7 @@ int shmdt(FAR const void *shmaddr) ret = up_shmdt((uintptr_t)shmaddr, npages); if (ret < 0) { - shmdbg("up_shmdt() failed\n"); + shmdbg("%s up_shmdt() \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); } /* Indicate that there is no longer any mapping for this region. */ diff --git a/os/mm/shm/shmget.c b/os/mm/shm/shmget.c index 36671ad0ae..623dd239d9 100644 --- a/os/mm/shm/shmget.c +++ b/os/mm/shm/shmget.c @@ -65,6 +65,7 @@ #include #include +#include #include "shm/shm.h" @@ -211,7 +212,7 @@ static int shm_extend(int shmid, size_t size) region->sr_pages[pgalloc] = mm_pgalloc(1); if (region->sr_pages[pgalloc] == 0) { - shmdbg("mm_pgalloc(1) failed\n"); + shmdbg("%s mm_pgalloc(1)\n", clog_message_str[CMN_LOG_FAILED_OP]); break; } @@ -270,7 +271,7 @@ static int shm_create(key_t key, size_t size, int shmflg) ret = shm_reserve(key, shmflg); if (ret < 0) { - shmdbg("shm_reserve failed: %d\n", ret); + shmdbg("%s shm_reserve : %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], ret); return ret; } @@ -415,7 +416,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_create(key, size, shmflg); if (ret < 0) { - shmdbg("shm_create failed: %d\n", ret); + shmdbg("%s shm_create : %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], ret); goto errout_with_semaphore; } @@ -452,7 +453,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_extend(shmid, size); if (ret < 0) { - shmdbg("shm_create failed: %d\n", ret); + shmdbg("%s shm_create : %d\n", clog_message_str[CMN_LOG_ALLOC_FAIL], ret); goto errout_with_semaphore; } } else { diff --git a/os/mm/umm_heap/umm_malloc.c b/os/mm/umm_heap/umm_malloc.c index 936a3ff517..ceb3836923 100644 --- a/os/mm/umm_heap/umm_malloc.c +++ b/os/mm/umm_heap/umm_malloc.c @@ -59,6 +59,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -110,7 +111,7 @@ void *malloc_at(int heap_index, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("malloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s malloc_at. Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/umm_heap/umm_memalign.c b/os/mm/umm_heap/umm_memalign.c index 25d0339352..bc3f88f195 100644 --- a/os/mm/umm_heap/umm_memalign.c +++ b/os/mm/umm_heap/umm_memalign.c @@ -58,6 +58,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -93,7 +94,7 @@ void *memalign_at(int heap_index, size_t alignment, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("memalign_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s memalign_at , Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/mm/umm_heap/umm_zalloc.c b/os/mm/umm_heap/umm_zalloc.c index 85bad9f09a..eb9aecb090 100644 --- a/os/mm/umm_heap/umm_zalloc.c +++ b/os/mm/umm_heap/umm_zalloc.c @@ -59,6 +59,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -90,7 +91,7 @@ void *zalloc_at(int heap_index, size_t size) ARCH_GET_RET_ADDRESS(caller_retaddr) #endif if (heap_index > HEAP_END_IDX || heap_index < HEAP_START_IDX) { - mdbg("zalloc_at failed. Wrong heap index (%d) of (%d)\n", heap_index, HEAP_END_IDX); + mdbg("%s zalloc_at, Wrong heap index (%d) of (%d)\n", clog_message_str[CMN_LOG_ALLOC_FAIL], heap_index, HEAP_END_IDX); return NULL; } diff --git a/os/net/bluetooth/bluetooth.c b/os/net/bluetooth/bluetooth.c index c9282ce76d..cce60470b5 100644 --- a/os/net/bluetooth/bluetooth.c +++ b/os/net/bluetooth/bluetooth.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "bt_buf.h" #include "bt_keys.h" @@ -237,7 +238,7 @@ static int read_local_name(void) err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LOCAL_NAME, NULL, &rsp); if (err) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", err); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], err); return err; } @@ -300,7 +301,7 @@ static int bt_conn_init(void) err = bt_l2cap_init(); if (err < 0) { - ndbg("ERROR: l2cap init failed: %d\n", err); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], err); return err; } @@ -315,13 +316,13 @@ static int bt_init(void) ret = hci_initialize(); if (ret < 0) { - ndbg("ERROR: hci_initialize failed: %d\n", ret); + ndbg("%s hci_initialize, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } ret = bt_conn_init(); if (ret < 0) { - ndbg("ERROR: bt_conn_init failed: %d\n", ret); + ndbg("%s bt_conn_init %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -347,7 +348,7 @@ static void k_work_submit(void) if (work_available(&g_lowp_work)) { err = work_queue(LPWORK, &g_lowp_work, init_work, NULL, 0); if (err < 0) { - ndbg("ERROR: Failed to schedule HPWORK: %d\n", err); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], err); } } } @@ -1389,7 +1390,7 @@ static int start_le_scan(uint8_t scan_type, uint16_t interval, uint16_t window) int err; buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_PARAMS, sizeof(*set_param)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1766,7 +1767,7 @@ void slave_update_conn_param(struct bt_conn_s *conn) if (work_available(&g_lowp_work)) { err = work_queue(LPWORK, &g_lowp_work, conn_le_update_timeout, conn, MSEC2TICK(CONN_UPDATE_TIMEOUT)); if (err < 0) { - ndbg("ERROR: Failed to schedule HPWORK: %d\n", err); + ndbg("%s to schedule HPWORK: %d\n", clog_message_str[CMN_LOG_FAILED_OP], err); } } } diff --git a/os/net/bluetooth/bt_buf.c b/os/net/bluetooth/bt_buf.c index 545cf59984..dd32fd1e9c 100644 --- a/os/net/bluetooth/bt_buf.c +++ b/os/net/bluetooth/bt_buf.c @@ -57,6 +57,7 @@ #include #include #include +#include #include "bt_hcicore.h" @@ -294,7 +295,7 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type, FAR struct iob_s *iob if (buf == NULL) { /* No.. memory not available */ - ndbg("ERROR: Failed to allocate buffer.\n"); + ndbg("%s\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return NULL; } @@ -332,7 +333,7 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type, FAR struct iob_s *iob buf->frame = iob_alloc(false); if (!buf->frame) { - ndbg("ERROR: Failed to allocate an IOB\n"); + ndbg("%s IOB\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); bt_buf_release(buf); return NULL; } diff --git a/os/net/bluetooth/bt_conn.c b/os/net/bluetooth/bt_conn.c index 1cbb0a85ca..52fc9fd40e 100644 --- a/os/net/bluetooth/bt_conn.c +++ b/os/net/bluetooth/bt_conn.c @@ -56,6 +56,7 @@ #include #include #include +#include #include "bt_atomic.h" #include "bt_queue.h" @@ -304,7 +305,7 @@ void bt_conn_receive(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf, uint8 nvdbg("Cont, len %u rx_len %u\n", buf->len, conn->rx_len); if (buf->len > bt_buf_tailroom(conn->rx)) { - ndbg("ERROR: Not enough buffer space for L2CAP data\n"); + ndbg("%s L2CAP data\n",clog_message_str[CMN_LOG_ALLOC_FAIL],); bt_conn_reset_rx_state(conn); bt_buf_release(buf); return; diff --git a/os/net/bluetooth/bt_gatt.c b/os/net/bluetooth/bt_gatt.c index 42b056a74c..be0387c959 100644 --- a/os/net/bluetooth/bt_gatt.c +++ b/os/net/bluetooth/bt_gatt.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "bt_hcicore.h" #include "bt_conn.h" @@ -645,7 +646,7 @@ int bt_gatt_discover(FAR struct bt_conn_s *conn, FAR struct bt_gatt_discover_par break; default: - ndbg("ERROR: Unkown UUID type %u\n", params->uuid->type); + ndbg("%s UUID type %u\n", clog_message_str[CMN_LOG_FAILED_OP], params->uuid->type); bt_buf_release(buf); return -EINVAL; } @@ -679,7 +680,7 @@ static void att_read_type_rsp(FAR struct bt_conn_s *conn, uint8_t err, FAR const break; default: - ndbg("ERROR: Invalid data len %u\n", rsp->len); + ndbg("%s len %u\n", clog_message_str[CMN_LOG_FAILED_OP], rsp->len); goto done; } diff --git a/os/net/bluetooth/bt_hcicore.c b/os/net/bluetooth/bt_hcicore.c index 272b18365b..3dbdf232d1 100644 --- a/os/net/bluetooth/bt_hcicore.c +++ b/os/net/bluetooth/bt_hcicore.c @@ -61,6 +61,7 @@ #include #include #include +#include #include "bt_queue.h" #include "bt_buf.h" @@ -301,7 +302,7 @@ static void hci_cmd_done(uint16_t opcode, uint8_t status, FAR struct bt_buf_s *b } if (g_btdev.sent_cmd->u.hci.opcode != opcode) { - ndbg("ERROR: Unexpected completion of opcode 0x%04x\n", opcode); + ndbg("%s: opcode 0x%04x\n", clog_message_str[CMN_LOG_FAILED_OP], opcode); return; } @@ -462,7 +463,7 @@ static int bt_hci_start_scanning(uint8_t scan_type, uint8_t scan_filter) buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_PARAMS, sizeof(*set_param)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -482,7 +483,7 @@ static int bt_hci_start_scanning(uint8_t scan_type, uint8_t scan_filter) bt_hci_cmd_send(BT_HCI_OP_LE_SET_SCAN_PARAMS, buf); buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_ENABLE, sizeof(*scan_enable)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -493,7 +494,7 @@ static int bt_hci_start_scanning(uint8_t scan_type, uint8_t scan_filter) ret = bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_SCAN_ENABLE, buf, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -521,7 +522,7 @@ static int bt_hci_stop_scanning(void) buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_ENABLE, sizeof(*scan_enable)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -532,7 +533,7 @@ static int bt_hci_stop_scanning(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_SCAN_ENABLE, buf, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync : %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -554,7 +555,7 @@ int hci_le_create_conn(FAR const bt_addr_le_t *addr) buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CONN, sizeof(*cp)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1128,7 +1129,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LOCAL_FEATURES, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1139,7 +1140,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LOCAL_VERSION_INFO, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1150,7 +1151,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_READ_BD_ADDR, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1169,7 +1170,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_LOCAL_FEATURES, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1180,7 +1181,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_BUFFER_SIZE, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1189,7 +1190,7 @@ int hci_initialize(void) buf = bt_hci_cmd_create(BT_HCI_OP_SET_EVENT_MASK, sizeof(*ev)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1213,7 +1214,7 @@ int hci_initialize(void) buf = bt_hci_cmd_create(BT_HCI_OP_HOST_BUFFER_SIZE, sizeof(*hbs)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1224,13 +1225,13 @@ int hci_initialize(void) ret = bt_hci_cmd_send(BT_HCI_OP_HOST_BUFFER_SIZE, buf); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } buf = bt_hci_cmd_create(BT_HCI_OP_SET_CTL_TO_HOST_FLOW, 1); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1239,7 +1240,7 @@ int hci_initialize(void) ret = bt_hci_cmd_send_sync(BT_HCI_OP_SET_CTL_TO_HOST_FLOW, buf, NULL); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1251,7 +1252,7 @@ int hci_initialize(void) if (!g_btdev.le_mtu) { ret = bt_hci_cmd_send_sync(BT_HCI_OP_READ_BUFFER_SIZE, NULL, &rsp); if (ret < 0) { - ndbg("ERROR: bt_hci_cmd_send_sync failed: %d\n", ret); + ndbg("%s bt_hci_cmd_send_sync: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1261,7 +1262,7 @@ int hci_initialize(void) buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_LE_HOST_SUPP, sizeof(*cp)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s bt_hci_cmd_create \n", clog_message_str[CMN_LOG_ALLOC_FAIL],); return -ENOBUFS; } @@ -1339,19 +1340,19 @@ int bt_initialize_internal(void) ret = btdev->open(btdev); if (ret < 0) { - ndbg("ERROR: HCI driver open failed (%d)\n", ret); + ndbg("%s To open HCI driver (%d)\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], ret); return ret; } ret = hci_initialize(); if (ret < 0) { - ndbg("ERROR: hci_initialize failed: %d\n", ret); + ndbg("%s: hci_initialize: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } ret = bt_l2cap_init(); if (ret < 0) { - ndbg("ERROR: l2cap_initialise failed: %d\n", ret); + ndbg("%s: l2cap_initialise: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); return ret; } @@ -1468,7 +1469,7 @@ void bt_hci_receive(FAR struct bt_buf_s *buf) if (work_available(&g_hp_work)) { ret = work_queue(HPWORK, &g_hp_work, hci_rx_work, &g_hp_rxlist, 0); if (ret < 0) { - ndbg("ERROR: Failed to schedule HPWORK: %d\n", ret); + ndbg("%s schedule HPWORK, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); } } @@ -1488,7 +1489,7 @@ void bt_hci_receive(FAR struct bt_buf_s *buf) if (work_available(&g_lp_work)) { ret = work_queue(LPWORK, &g_lp_work, hci_rx_work, &g_lp_rxlist, 0); if (ret < 0) { - ndbg("ERROR: Failed to schedule LPWORK: %d\n", ret); + ndbg("%s: schedule LPWORK, %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); } } } @@ -1537,7 +1538,7 @@ int bt_hci_cmd_send(uint16_t opcode, FAR struct bt_buf_s *buf) if (buf == NULL) { buf = bt_hci_cmd_create(opcode, 0); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } } @@ -1556,7 +1557,7 @@ int bt_hci_cmd_send(uint16_t opcode, FAR struct bt_buf_s *buf) ret = bt_queue_send(g_btdev.tx_queue, buf, BT_NORMAL_PRIO); if (ret < 0) { - ndbg("ERROR: bt_queue_send() failed: %d\n", ret); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; @@ -1575,7 +1576,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct bt_buf_s *buf, FAR struct b if (buf == NULL) { buf = bt_hci_cmd_create(opcode, 0); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } } @@ -1592,7 +1593,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct bt_buf_s *buf, FAR struct b ret = bt_queue_send(g_btdev.tx_queue, buf, BT_NORMAL_PRIO); if (ret < 0) { - ndbg("ERROR: bt_queue_send() failed: %d\n", ret); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); } else { struct timespec abstime; @@ -1691,7 +1692,7 @@ int bt_start_advertising(uint8_t type, FAR const struct bt_eir_s *ad, FAR const buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(*set_data)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1719,7 +1720,7 @@ int bt_start_advertising(uint8_t type, FAR const struct bt_eir_s *ad, FAR const buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_RSP_DATA, sizeof(*scan_rsp)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL],); return -ENOBUFS; } @@ -1743,7 +1744,7 @@ int bt_start_advertising(uint8_t type, FAR const struct bt_eir_s *ad, FAR const send_set_param: buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAMETERS, sizeof(*set_param)); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1759,7 +1760,7 @@ int bt_start_advertising(uint8_t type, FAR const struct bt_eir_s *ad, FAR const buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } @@ -1791,7 +1792,7 @@ int bt_stop_advertising(void) buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); if (buf == NULL) { - ndbg("ERROR: Failed to create buffer\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOBUFS; } diff --git a/os/net/bluetooth/bt_ioctl.c b/os/net/bluetooth/bt_ioctl.c index 1800096a95..b0e4cc7c8f 100644 --- a/os/net/bluetooth/bt_ioctl.c +++ b/os/net/bluetooth/bt_ioctl.c @@ -51,6 +51,7 @@ #include #include #include +#include #include "bt_hcicore.h" #include "bt_conn.h" @@ -859,7 +860,7 @@ int btnet_ioctl(FAR struct net_driver_s *netdev, int cmd, unsigned long arg) } if (ret < 0) { - ndbg("ERROR: Failed to start discovery: %d\n", ret); + ndbg("%s to start discovery: %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); btnet_discover_destroy(params); } @@ -927,7 +928,7 @@ int btnet_ioctl(FAR struct net_driver_s *netdev, int cmd, unsigned long arg) } if (ret < 0) { - ndbg("ERROR: Read operation failed: %d\n", ret); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FILE_READ_ERROR], ret); } bt_conn_release(conn); diff --git a/os/net/bluetooth/bt_keys.c b/os/net/bluetooth/bt_keys.c index 7a0cb047ba..710922cfb9 100644 --- a/os/net/bluetooth/bt_keys.c +++ b/os/net/bluetooth/bt_keys.c @@ -50,6 +50,7 @@ #include #include +#include #include "bt_hcicore.h" #include "bt_smp.h" @@ -260,7 +261,7 @@ void bt_keys_add_type(FAR struct bt_keys_s *keys, int type) break; default: - ndbg("ERROR: Unknown key type %d\n", type); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], type); return; } diff --git a/os/net/bluetooth/bt_l2cap.c b/os/net/bluetooth/bt_l2cap.c index 2205adb5b5..acd3eaf353 100644 --- a/os/net/bluetooth/bt_l2cap.c +++ b/os/net/bluetooth/bt_l2cap.c @@ -51,6 +51,7 @@ #include #include +#include #include "bt_hcicore.h" #include "bt_conn.h" @@ -207,7 +208,7 @@ static void le_conn_param_rsp(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *b struct bt_l2cap_conn_param_rsp_s *rsp = (void *)buf->data; if (buf->len < sizeof(*rsp)) { - ndbg("ERROR: Too small LE conn param rsp\n"); + ndbg("%s Too small LE conn param rsp\n", clog_message_str[CMN_LOG_FAILED_OP]); return; } @@ -250,7 +251,7 @@ static void le_conn_param_update_req(FAR struct bt_conn_s *conn, uint8_t ident, uint16_t result; if (buf->len < sizeof(*req)) { - ndbg("ERROR: Too small LE conn update param req\n"); + ndbg("%s Too small LE conn update param req\n", clog_message_str[CMN_LOG_FAILED_OP]); return; } @@ -304,12 +305,12 @@ static void le_sig(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf, FAR voi nvdbg("LE signaling code 0x%02x ident %u len %u\n", hdr->code, hdr->ident, len); if (buf->len != len) { - ndbg("ERROR: L2CAP length mismatch (%u != %u)\n", buf->len, len); + ndbg("%s L2CAP length mismatch (%u != %u)\n", clog_message_str[CMN_LOG_FAILED_OP], buf->len, len); goto drop; } if (!hdr->ident) { - ndbg("ERROR: Invalid ident value in L2CAP PDU\n"); + ndbg("%s Invalid ident value in L2CAP PDU\n", clog_message_str[CMN_LOG_FAILED_OP]); goto drop; } @@ -339,7 +340,7 @@ void bt_l2cap_receive(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf) uint16_t cid; if (buf->len < sizeof(*hdr)) { - ndbg("ERROR: Too small L2CAP PDU received\n"); + ndbg("%s Too small L2CAP PDU received\n", clog_message_str[CMN_LOG_FAILED_OP]); bt_buf_release(buf); return; } diff --git a/os/net/bluetooth/bt_netdev.c b/os/net/bluetooth/bt_netdev.c index c1c5edaa9e..e245ff2f27 100644 --- a/os/net/bluetooth/bt_netdev.c +++ b/os/net/bluetooth/bt_netdev.c @@ -57,6 +57,7 @@ #include #include #include +#include /* #include */ #include /* #include */ @@ -881,7 +882,7 @@ static int btnet_req_data(FAR struct radio_driver_s *netdev, FAR const void *met buf = bt_buf_alloc(BT_ACL_OUT, iob, BLUETOOTH_MAX_HDRLEN); if (buf == NULL) { - ndbg("ERROR: Failed to allocate buffer container\n"); + ndbg("%s buffer container\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/net/bluetooth/bt_queue.c b/os/net/bluetooth/bt_queue.c index b133eb3dd5..122d896a50 100644 --- a/os/net/bluetooth/bt_queue.c +++ b/os/net/bluetooth/bt_queue.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "bt_queue.h" @@ -109,7 +110,7 @@ int bt_queue_open(FAR const char *name, int oflags, int nmsgs, FAR mqd_t *mqd) /* REVISIT: mq_open() modifies the errno value */ ret = -get_errno(); - ndbg("ERROR: mq_open(%s) failed: %d\n", name, ret); + ndbg("%s (%s) error: %d\n", clog_message_str[CMN_LOG_FILE_OPEN_ERROR], name, ret); newmqd = NULL; } @@ -150,7 +151,7 @@ int bt_queue_receive(mqd_t mqd, FAR struct bt_buf_s **buf) u.msg.buf = NULL; msgsize = mq_receive(mqd, u.msgbuf, BT_MSGSIZE, &priority); if (msgsize < 0) { - ndbg("ERROR: mq_receive() failed: %ld\n", (long)msgsize); + ndbg("%s %ld\n", clog_message_str[CMN_LOG_FAILED_OP], (long)msgsize); return (int)msgsize; } @@ -199,7 +200,7 @@ int bt_queue_send(mqd_t mqd, FAR struct bt_buf_s *buf, int priority) msg.buf = buf; ret = mq_send(mqd, (FAR const char *)&msg, sizeof(struct bt_bufmsg_s), priority); if (ret < 0) { - ndbg("ERROR: mq_send() failed: %d\n", ret); + ndbg("%s %d\n", clog_message_str[CMN_LOG_FAILED_OP], ret); } return ret; diff --git a/os/net/bluetooth/bt_smp.c b/os/net/bluetooth/bt_smp.c index cf18bbfa62..52ccf0564a 100644 --- a/os/net/bluetooth/bt_smp.c +++ b/os/net/bluetooth/bt_smp.c @@ -51,6 +51,7 @@ #include #include +#include #include "bt_atomic.h" #include "bt_hcicore.h" @@ -360,7 +361,7 @@ static int le_rand(FAR void *buf, size_t len) err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_RAND, NULL, &rsp); if (err) { - ndbg("ERROR: HCI_LE_Random failed (%d)\n", err); + ndbg("%s: HCI_LE_Random (%d)\n", clog_message_str[CMN_LOG_FAILED_OP], err); return err; } @@ -711,7 +712,7 @@ static uint8_t smp_pairing_random(FAR struct bt_conn_s *conn, FAR struct bt_buf_ /* Rand and EDiv are 0 for the STK */ if (bt_conn_le_start_encryption(conn, 0, 0, stk)) { - ndbg("ERROR: Failed to start encryption\n"); + ndbg("%s To start encryption\n", clog_message_str[CMN_LOG_FAILED_OP]); return BT_SMP_ERR_UNSPECIFIED; } @@ -722,7 +723,7 @@ static uint8_t smp_pairing_random(FAR struct bt_conn_s *conn, FAR struct bt_buf_ keys = bt_keys_get_type(BT_KEYS_SLAVE_LTK, &conn->dst); if (keys == NULL) { - ndbg("ERROR: Unable to create new keys\n"); + ndbg("%s \n", clog_message_str[CMN_LOG_FAILED_OP]); return BT_SMP_ERR_UNSPECIFIED; } @@ -750,7 +751,7 @@ static uint8_t smp_pairing_failed(FAR struct bt_conn_s *conn, FAR struct bt_buf_ struct bt_smp_pairing_fail_s *req = (void *)buf->data; struct bt_smp_s *smp = conn->smp; - ndbg("ERROR: reason 0x%x\n", req->reason); + ndbg("%s: reason 0x%x\n", clog_message_str[CMN_LOG_FAILED_OP], req->reason); UNUSED(req); bt_atomic_set(&smp->allowed_cmds, 0); @@ -795,7 +796,7 @@ static void bt_smp_distribute_keys(FAR struct bt_conn_s *conn) buf = bt_smp_create_pdu(conn, BT_SMP_CMD_ENCRYPT_INFO, sizeof(struct bt_smp_encrypt_info_s)); if (!buf) { - ndbg("ERROR: Unable to allocate Encrypt Info buffer\n"); + ndbg("%s Encrypt Info buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return; } @@ -806,7 +807,7 @@ static void bt_smp_distribute_keys(FAR struct bt_conn_s *conn) buf = bt_smp_create_pdu(conn, BT_SMP_CMD_MASTER_IDENT, sizeof(struct bt_smp_master_ident_s)); if (!buf) { - ndbg("ERROR: Unable to allocate Master Ident buffer\n"); + ndbg("%s Master Ident buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); return; } @@ -1294,7 +1295,7 @@ static int aes_test(const char *prefix, const uint8_t *key, const uint8_t *m, ui if (!memcmp(out, mac, 16)) { nvdbg("%s: Success\n", prefix); } else { - ndbg("ERROR: %s: Failed\n", prefix); + ndbg("%s %s: \n",clog_message_str[CMN_LOG_FAILED_OP], prefix); return -1; } diff --git a/os/pm/pm_domain_register.c b/os/pm/pm_domain_register.c index 0baad0ac4e..c8353b5de7 100644 --- a/os/pm/pm_domain_register.c +++ b/os/pm/pm_domain_register.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "pm.h" @@ -60,7 +61,7 @@ int pm_check_domain(int domain_id) { if (domain_id < 0 || domain_id >= CONFIG_PM_NDOMAINS || pm_domain_map[domain_id] == NULL) { set_errno(EINVAL); - pmdbg("Invalid Domain: %d\n", domain_id); + pmdbg("%s id: %d\n", clog_message_str[CMN_LOG_INVALID_VAL], domain_id); return ERROR; } return OK; @@ -101,7 +102,7 @@ int pm_domain_register(char *domain) pm_domain_map[index] = (char *)kmm_malloc(length * sizeof(char)); if (!pm_domain_map[index]) { set_errno(ENOMEM); - pmdbg("Unable to allocate memory from heap\n"); + pmdbg("%s\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); leave_critical_section(flags); return ERROR; } diff --git a/os/pm/pm_idle.c b/os/pm/pm_idle.c index d29f19dc7c..703f3b385d 100644 --- a/os/pm/pm_idle.c +++ b/os/pm/pm_idle.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "pm.h" @@ -89,7 +90,7 @@ void pm_idle(void) /* Then force the global state change */ if (pm_changestate(newstate) < 0) { /* The new state change failed */ - pmdbg("State change failed! newstate = %d\n", newstate); + pmdbg("%s: newstate = %d\n", clog_message_str[CMN_LOG_FAILED_OP], newstate); goto EXIT; } /* If current state is not good to go sleep then do core power saving*/ diff --git a/os/pm/pm_metrics.c b/os/pm/pm_metrics.c index ff645b8068..93bff8e584 100644 --- a/os/pm/pm_metrics.c +++ b/os/pm/pm_metrics.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -275,7 +276,7 @@ int pm_metrics(int milliseconds) g_pm_metrics = pm_alloc(1, sizeof(pm_metric_t)); if (g_pm_metrics == NULL) { set_errno(ENOMEM); - pmdbg("Unable to initialize pm_metrics, error = %d\n", get_errno()); + pmdbg("%s initialize pm_metrics, error = %d\n", clog_message_str[CMN_LOG_FAILED_OP], get_errno()); pm_unlock(); return ERROR; } @@ -297,7 +298,7 @@ int pm_metrics(int milliseconds) pm_resumed = pm_resume(PM_IDLE_DOMAIN); } else { pm_resumed = -1; - pmdbg("Unable to resume IDLE Domain\n"); + pmdbg("%s: Resume IDLE Domain\n",clog_message_str[CMN_LOG_FAILED_OP]); } /* Suspend for given time interval */ pm_sleep(TICK2MSEC(MSEC2TICK(milliseconds) - (clock_systimer() - start_time))); @@ -306,7 +307,7 @@ int pm_metrics(int milliseconds) pm_suspended = pm_suspend(PM_IDLE_DOMAIN); } else { pm_suspended = -1; - pmdbg("Unable to suspend IDLE Domain\n"); + pmdbg("%s: Suspend IDLE Domain\n", clog_message_str[CMN_LOG_FAILED_OP]); } /* PM Metrics post calculations for consistent result */ flags = enter_critical_section(); @@ -330,7 +331,7 @@ int pm_metrics(int milliseconds) pm_resumed = pm_resume(PM_IDLE_DOMAIN); } else { pm_resumed = -1; - pmdbg("Unable to resume IDLE Domain\n"); + pmdbg("%s: Resume IDLE Domain\n", clog_message_str[CMN_LOG_FAILED_OP]); } /* Unlock PM Metrics for other threads */ pm_unlock(); diff --git a/os/pm/pm_procfs.c b/os/pm/pm_procfs.c index 4d1c6e10d3..1fb6b13194 100644 --- a/os/pm/pm_procfs.c +++ b/os/pm/pm_procfs.c @@ -75,6 +75,7 @@ #include #include #include +#include #include @@ -206,7 +207,7 @@ static int power_find_dirref(FAR const char *relpath, FAR struct power_dir_s *di /* Skip the "power/domains" portion of relpath. We accept it only now */ len = strlen(POWER_SUBDIRPATH_DOMAINS); if (strncmp(relpath, POWER_SUBDIRPATH_DOMAINS, len) != 0) { - fdbg("Invalid Path : Failed to find path %s \n", relpath); + fdbg("%s: path %s \n", clog_message_str[CMN_LOG_FAILED_OP], relpath); return -ENOENT; } relpath += len; @@ -227,7 +228,7 @@ static int power_find_dirref(FAR const char *relpath, FAR struct power_dir_s *di str = NULL; if (!str) { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + fdbg("%s: path \"%s\"\n", clog_message_str[CMN_LOG_FAILED_OP], relpath); return -ENOENT; } @@ -364,7 +365,7 @@ static int power_open(FAR struct file *filep, FAR const char *relpath, int oflag /* Allocate a container to hold the task and attribute selection */ priv = (FAR struct power_file_s *)kmm_malloc(sizeof(struct power_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + fdbg("%s file attributes\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -493,7 +494,7 @@ static int power_dup(FAR const struct file *oldp, FAR struct file *newp) newfile = (FAR struct power_file_s *)kmm_malloc(sizeof(struct power_file_s)); if (!newfile) { - fdbg("ERROR: Failed to allocate file container\n"); + fdbg("%s file container\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } @@ -529,7 +530,7 @@ static int power_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) powerdir = (FAR struct power_dir_s *)kmm_malloc(sizeof(struct power_dir_s)); if (!powerdir) { - fdbg("ERROR: Failed to allocate the directory structure\n"); + fdbg("%s for directory structure\n",clog_message_str[CMN_LOG_ALLOC_FAIL]); return -ENOMEM; } diff --git a/os/pm/pm_sleep.c b/os/pm/pm_sleep.c index f2cc8fa38f..394e0cdb35 100644 --- a/os/pm/pm_sleep.c +++ b/os/pm/pm_sleep.c @@ -56,6 +56,7 @@ #include #include #include +#include #include /************************************************************************ * Pre-processor Definitions @@ -118,19 +119,19 @@ int pm_sleep(int milliseconds) rtcb->waitdog = wd_create(); if (!rtcb->waitdog) { set_errno(EAGAIN); - pmdbg("Error creating wdog timer\n"); + pmdbg("%s: wdog timer creation\n", clog_message_str[CMN_LOG_FAILED_OP]); goto errout; } /* set this timer as wakeup source */ if (wd_setwakeupsource(rtcb->waitdog) != OK) { - pmdbg("Error setting wakeup flag to wdog timer\n"); + pmdbg("%s setting wakeup flag to wdog timer\n", clog_message_str[CMN_LOG_FAILED_OP]); wd_delete(rtcb->waitdog); goto errout; } /* before going into sleep start the wakeup timer */ ret = wd_start(rtcb->waitdog, MSEC2TICK(milliseconds), (wdentry_t)pm_timer_callback, 1, (uint32_t)&pm_sem); if (ret != OK) { - pmdbg("pm_sleep: wd_start failed\n"); + pmdbg("%s: wd_start\n", clog_message_str[CMN_LOG_FAILED_OP]); wd_delete(rtcb->waitdog); goto errout; } diff --git a/os/pm/pm_timedsuspend.c b/os/pm/pm_timedsuspend.c index ec134c73de..1cefbe7d1b 100644 --- a/os/pm/pm_timedsuspend.c +++ b/os/pm/pm_timedsuspend.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include "pm.h" @@ -116,7 +117,7 @@ int pm_timedsuspend(int domain_id, unsigned int milliseconds) int delay = MSEC2TICK(milliseconds); if ((domain_id < 0) || (domain_id >= CONFIG_PM_NDOMAINS) || (pm_domain_map[domain_id] == NULL)) { set_errno(EINVAL); - pmdbg("Invalid domain_id: %d\n", domain_id); + pmdbg("%s id: %d\n", clog_message_str[CMN_LOG_INVALID_VAL], domain_id); return ret; } flags = enter_critical_section(); @@ -133,13 +134,13 @@ int pm_timedsuspend(int domain_id, unsigned int milliseconds) if (!wdog) { wdog = wd_create(); if (wdog == NULL) { - pmdbg("Unable to create WDog Timer, error = %d\n", get_errno()); + pmdbg("%s to create WDog Timer, error = %d\n", clog_message_str[CMN_LOG_FAILED_OP], get_errno()); set_errno(EAGAIN); goto exit; } /* Unable to suspend domain, so delete the timer */ if (pm_suspend(domain_id) != OK) { - pmdbg("Unable to suspend domain: %s\n", pm_domain_map[domain_id]); + pmdbg("%s to suspend domain: %s\n", clog_message_str[CMN_LOG_FAILED_OP], pm_domain_map[domain_id]); (void)wd_delete(wdog); goto exit; } @@ -154,7 +155,7 @@ int pm_timedsuspend(int domain_id, unsigned int milliseconds) } /* Start the timer */ if (wd_start(wdog, delay, (wdentry_t)timer_timeout, 1, domain_id) != OK) { - pmdbg("Error starting Wdog timer\n"); + pmdbg("%s start Wdog timer \n", clog_message_str[CMN_LOG_FAILED_OP]); set_errno(EAGAIN); timer_timeout(NULL, domain_id); goto exit;