audio/, crypto/, libnx/, and mm/: Change some err() ERRORS to warn() WARNINGS or info()

This commit is contained in:
Gregory Nutt
2016-06-12 09:46:23 -06:00
parent 0665c7e06c
commit b29a4dd49c
23 changed files with 74 additions and 65 deletions
+2 -2
View File
@@ -832,7 +832,7 @@ static void audio_callback(FAR void *handle, uint16_t reason,
default:
{
auderr("Unknown callback reason code %d\n", reason);
auderr("ERROR: Unknown callback reason code %d\n", reason);
break;
}
}
@@ -885,7 +885,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)
{
auderr("Allocation failed\n");
auderr("ERROR: Allocation failed\n");
return -ENOMEM;
}
+18 -18
View File
@@ -259,23 +259,23 @@ static void pcm_callback(FAR void *arg, uint16_t reason,
#ifdef CONFIG_PCM_DEBUG
static void pcm_dump(FAR const struct wav_header_s *wav)
{
err("Wave file header\n");
err(" Header Chunk:\n");
err(" Chunk ID: 0x%08x\n", wav->hdr.chunkid);
err(" Chunk Size: %u\n", wav->hdr.chunklen);
err(" Format: 0x%08x\n", wav->hdr.format);
err(" Format Chunk:\n");
err(" Chunk ID: 0x%08x\n", wav->fmt.chunkid);
err(" Chunk Size: %u\n", wav->fmt.chunklen);
err(" Audio Format: 0x%04x\n", wav->fmt.format);
err(" Num. Channels: %d\n", wav->fmt.nchannels);
err(" Sample Rate: %u\n", wav->fmt.samprate);
err(" Byte Rate: %u\n", wav->fmt.byterate);
err(" Block Align: %d\n", wav->fmt.align);
err(" Bits Per Sample: %d\n", wav->fmt.bpsamp);
err(" Data Chunk:\n");
err(" Chunk ID: 0x%08x\n", wav->data.chunkid);
err(" Chunk Size: %u\n", wav->data.chunklen);
info("Wave file header\n");
info(" Header Chunk:\n");
info(" Chunk ID: 0x%08x\n", wav->hdr.chunkid);
info(" Chunk Size: %u\n", wav->hdr.chunklen);
info(" Format: 0x%08x\n", wav->hdr.format);
info(" Format Chunk:\n");
info(" Chunk ID: 0x%08x\n", wav->fmt.chunkid);
info(" Chunk Size: %u\n", wav->fmt.chunklen);
info(" Audio Format: 0x%04x\n", wav->fmt.format);
info(" Num. Channels: %d\n", wav->fmt.nchannels);
info(" Sample Rate: %u\n", wav->fmt.samprate);
info(" Byte Rate: %u\n", wav->fmt.byterate);
info(" Block Align: %d\n", wav->fmt.align);
info(" Bits Per Sample: %d\n", wav->fmt.bpsamp);
info(" Data Chunk:\n");
info(" Chunk ID: 0x%08x\n", wav->data.chunkid);
info(" Chunk Size: %u\n", wav->data.chunklen);
}
#endif
@@ -691,7 +691,7 @@ static int pcm_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
ret = lower->ops->getcaps(lower, type, caps);
if (ret < 0)
{
auderr("Lower getcaps() failed: %d\n", ret);
auderr("ERROR: Lower getcaps() failed: %d\n", ret);
return ret;
}
+1 -1
View File
@@ -81,7 +81,7 @@ int up_cryptoinitialize(void)
res = crypto_test();
if (res)
{
cryptllerr("crypto test failed\n");
cryptllerr("ERROR: crypto test failed\n");
}
else
{
+2 -2
View File
@@ -86,7 +86,7 @@ static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt)
#define AES_CYPHER_TEST_ENCRYPT(mode, mode_str, count, template) \
for (i = 0; i < count; i++) { \
if (do_test_aes(template + i, mode, CYPHER_ENCRYPT)) { \
cryptllerr("Failed " mode_str " encrypt test #%i\n", i); \
cryptllerr("ERROR: Failed " mode_str " encrypt test #%i\n", i); \
return -1; \
} \
}
@@ -94,7 +94,7 @@ static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt)
#define AES_CYPHER_TEST_DECRYPT(mode, mode_str, count, template) \
for (i = 0; i < count; i++) { \
if (do_test_aes(template + i, mode, CYPHER_DECRYPT)) { \
cryptllerr("Failed " mode_str " decrypt test #%i\n", i); \
cryptllerr("ERROR: Failed " mode_str " decrypt test #%i\n", i); \
return -1; \
} \
}
+3 -3
View File
@@ -475,7 +475,7 @@ static inline FAR const struct nx_fontset_s *
fontset = &package->font8;
#else
gerr("8-bit font support disabled: %d\n", ch);
gwarn("WARNING: 8-bit font support disabled: %d\n", ch);
return NULL;
#endif
}
@@ -483,7 +483,7 @@ static inline FAR const struct nx_fontset_s *
{
/* Someday, perhaps 16-bit fonts will go here */
gerr("16-bit font not currently supported\n");
gerr("ERROR: 16-bit font not currently supported\n");
return NULL;
}
@@ -494,7 +494,7 @@ static inline FAR const struct nx_fontset_s *
return fontset;
}
gerr("No bitmap for code %02x\n", ch);
gerr("ERROR: No bitmap for code %02x\n", ch);
return NULL;
}
+1 -1
View File
@@ -133,7 +133,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
if (ret != OK)
{
gerr("sem_init failed: %d\n", errno);
gerr("ERROR: sem_init failed: %d\n", errno);
return ret;
}
+4 -4
View File
@@ -160,7 +160,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname)
#endif
if (conn->crdmq == (mqd_t)-1)
{
gerr("mq_open(%s) failed: %d\n", climqname, errno);
gerr("ERROR: mq_open(%s) failed: %d\n", climqname, errno);
goto errout_with_conn;
}
@@ -173,7 +173,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname)
conn->cwrmq = mq_open(svrmqname, O_WRONLY|O_CREAT, 0666, &attr);
if (conn->cwrmq == (mqd_t)-1)
{
gerr("mq_open(%s) failed: %d\n", svrmqname, errno);
gerr("ERROR: mq_open(%s) failed: %d\n", svrmqname, errno);
goto errout_with_rmq;
}
@@ -185,7 +185,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname)
ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s));
if (ret < 0)
{
gerr("nxmu_sendserver failed: %d\n", errno);
gerr("ERROR: nxmu_sendserver failed: %d\n", errno);
goto errout_with_wmq;
}
@@ -201,7 +201,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname)
ret = nx_eventhandler((NXHANDLE)conn);
if (ret < 0)
{
gerr("nx_message failed: %d\n", errno);
gerr("ERROR: nx_message failed: %d\n", errno);
goto errout_with_wmq;
}
usleep(300000);
+3 -2
View File
@@ -164,7 +164,7 @@ int nx_eventhandler(NXHANDLE handle)
}
else
{
gerr("mq_receive failed: %d\n", errno);
gerr("ERROR: mq_receive failed: %d\n", errno);
return ERROR;
}
}
@@ -254,7 +254,8 @@ int nx_eventhandler(NXHANDLE handle)
break;
default:
gerr("Unrecognized message opcode: %d\n", ((FAR struct nxsvrmsg_s *)buffer)->msgid);
gerr("ERROR: Unrecognized message opcode: %d\n",
((FAR struct nxsvrmsg_s *)buffer)->msgid);
break;
}
+1 -1
View File
@@ -127,7 +127,7 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
if (ret != OK)
{
gerr("sem_init failed: %d\n", errno);
gerr("ERROR: sem_init failed: %d\n", errno);
return ret;
}
+1 -1
View File
@@ -105,7 +105,7 @@ int nxmu_sendserver(FAR struct nxfe_conn_s *conn, FAR const void *msg,
ret = mq_send(conn->cwrmq, msg, msglen, NX_SVRMSG_PRIO);
if (ret < 0)
{
gerr("mq_send failed: %d\n", errno);
gerr("ERROR: mq_send failed: %d\n", errno);
}
return ret;
+1 -1
View File
@@ -93,7 +93,7 @@ void *operator new(unsigned int nbytes)
// Oh my.. we are required to return a valid pointer and
// we cannot throw an exception! We are bad.
err("Failed to allocate\n");
err("ERROR: Failed to allocate\n");
}
#endif
+1 -1
View File
@@ -93,7 +93,7 @@ void *operator new[](unsigned int nbytes)
// Oh my.. we are required to return a valid pointer and
// we cannot throw an exception! We are bad.
err("Failed to allocate\n");
err("ERROR: Failed to allocate\n");
}
#endif
+4 -4
View File
@@ -56,25 +56,25 @@ namespace std
{
void __throw_out_of_range(const char*)
{
err("C++: Vector .at() with argument out of range\n");
err("ERROR: C++: Vector .at() with argument out of range\n");
abort();
}
void __throw_length_error(const char*)
{
err("C++: Vector resize to excessive length\n");
err("ERROR: C++: Vector resize to excessive length\n");
abort();
}
void __throw_bad_alloc()
{
err("C++: Bad allocation\n");
err("ERROR: C++: Bad allocation\n");
abort();
}
void __throw_bad_function_call()
{
err("C++: Bad function call\n");
err("ERROR: C++: Bad function call\n");
abort();
}
}
+6 -2
View File
@@ -64,18 +64,22 @@
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_GRAM
# define granerr(format, ...) err(format, ##__VA_ARGS__)
# define granwarn(format, ...) warn(format, ##__VA_ARGS__)
# define graninfo(format, ...) info(format, ##__VA_ARGS__)
# else
# define granerr(format, ...) merr(format, ##__VA_ARGS__)
# define granwarn(format, ...) mwarn(format, ##__VA_ARGS__)
# define graninfo(format, ...) minfo(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG_GRAM
# define granerr err
# define granwarn warn
# define graninfo info
# else
# define granerr (void)
# define graninfo (void)
# define granerr merr
# define granwarn mwarn
# define graninfo minfo
# endif
#endif
+6 -2
View File
@@ -67,18 +67,22 @@
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_PGALLOC
# define pgaerr(format, ...) err(format, ##__VA_ARGS__)
# define pgawarn(format, ...) warn(format, ##__VA_ARGS__)
# define pgainfo(format, ...) info(format, ##__VA_ARGS__)
# else
# define pgaerr(format, ...) merr(format, ##__VA_ARGS__)
# define pgawarn(format, ...) mwarn(format, ##__VA_ARGS__)
# define pgainfo(format, ...) minfo(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG_PGALLOC
# define pgaerr err
# define pgawarn warn
# define pgainfo info
# else
# define pgaerr (void)
# define pgainfo (void)
# define pgaerr merr
# define pgawarn mwarn
# define pgainfo minfo
# endif
#endif
+2 -2
View File
@@ -96,7 +96,7 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
heapend = MM_ALIGN_DOWN((uintptr_t)heapstart + (uintptr_t)heapsize);
heapsize = heapend - heapbase;
mllerr("Region %d: base=%p size=%u\n", IDX+1, heapstart, heapsize);
mllinfo("Region %d: base=%p size=%u\n", IDX+1, heapstart, heapsize);
/* Add the size of this region to the total size of the heap */
@@ -157,7 +157,7 @@ void mm_initialize(FAR struct mm_heap_s *heap, FAR void *heapstart,
{
int i;
mllerr("Heap: start=%p size=%u\n", heapstart, heapsize);
mllinfo("Heap: start=%p size=%u\n", heapstart, heapsize);
/* The following two lines have cause problems for some older ZiLog
* compilers in the past (but not the more recent). Life is easier if we
+1 -1
View File
@@ -186,7 +186,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
#ifdef CONFIG_DEBUG_MM
if (!ret)
{
merr("Allocation failed, size %d\n", size);
mwarn("WARNING: Allocation failed, size %d\n", size);
}
else
{
+4 -4
View File
@@ -157,7 +157,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap)
{
/* Take the semaphore (perhaps waiting) */
msemerr("PID=%d taking\n", my_pid);
mseminfo("PID=%d taking\n", my_pid);
while (sem_wait(&heap->mm_semaphore) != 0)
{
/* The only case that an error should occur here is if
@@ -173,7 +173,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap)
heap->mm_counts_held = 1;
}
msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held);
mseminfo("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held);
}
/****************************************************************************
@@ -201,13 +201,13 @@ void mm_givesemaphore(FAR struct mm_heap_s *heap)
/* Yes, just release one count and return */
heap->mm_counts_held--;
msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held);
mseminfo("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held);
}
else
{
/* Nope, this is the last reference I have */
msemerr("PID=%d giving\n", my_pid);
mseminfo("PID=%d giving\n", my_pid);
heap->mm_holder = -1;
heap->mm_counts_held = 0;
+1 -1
View File
@@ -127,7 +127,7 @@ int shm_group_initialize(FAR struct task_group_s *group)
if (!group->tg_shm.gs_handle)
{
shmerr("gran_initialize() failed\n");
shmerr("ERROR: gran_initialize() failed\n");
return -ENOMEM;
}
+3 -3
View File
@@ -136,7 +136,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg)
ret = sem_wait(&region->sr_sem);
if (ret < 0)
{
shmerr("sem_wait failed: %d\n", ret);
shmerr("ERROR: sem_wait failed: %d\n", ret);
goto errout;
}
@@ -146,7 +146,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg)
region->sr_ds.shm_segsz);
if (vaddr == 0)
{
shmerr("gran_alloc() failed\n");
shmerr("ERROR: gran_alloc() failed\n");
ret = -ENOMEM;
goto errout_with_semaphore;
}
@@ -160,7 +160,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg)
ret = up_shmat(region->sr_pages, npages, vaddr);
if (ret < 0)
{
shmerr("up_shmat() failed\n");
shmerr("ERROR: up_shmat() failed\n");
goto errout_with_vaddr;
}
+2 -2
View File
@@ -134,7 +134,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf)
ret = sem_wait(&region->sr_sem);
if (ret < 0)
{
shmerr("sem_wait failed: %d\n", ret);
shmerr("ERROR: sem_wait failed: %d\n", ret);
return ret;
}
@@ -190,7 +190,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf)
break;
default:
shmerr("Unrecognized command: %d\n", cmd);
shmerr("ERROR: Unrecognized command: %d\n", cmd);
ret = -EINVAL;
goto errout_with_semaphore;
}
+3 -3
View File
@@ -106,7 +106,7 @@ int shmdt(FAR const void *shmaddr)
if (shmid >= CONFIG_ARCH_SHM_MAXREGIONS)
{
shmerr("No region matching this virtual address: %p\n", shmaddr);
shmerr("ERROR: No region matching this virtual address: %p\n", shmaddr);
ret = -EINVAL;
goto errout_with_errno;
}
@@ -121,7 +121,7 @@ int shmdt(FAR const void *shmaddr)
ret = sem_wait(&region->sr_sem);
if (ret < 0)
{
shmerr("sem_wait failed: %d\n", ret);
shmerr("ERROR: sem_wait failed: %d\n", ret);
goto errout;
}
@@ -141,7 +141,7 @@ int shmdt(FAR const void *shmaddr)
ret = up_shmdt((uintptr_t)shmaddr, npages);
if (ret < 0)
{
shmerr("up_shmdt() failed\n");
shmerr("ERROR: up_shmdt() failed\n");
}
/* Indicate that there is no longer any mapping for this region. */
+4 -4
View File
@@ -188,7 +188,7 @@ static int shm_extend(int shmid, size_t size)
region->sr_pages[pgalloc] = mm_pgalloc(1);
if (region->sr_pages[pgalloc] == 0)
{
shmerr("mm_pgalloc(1) failed\n");
shmerr("ERROR: mm_pgalloc(1) failed\n");
break;
}
@@ -249,7 +249,7 @@ static int shm_create(key_t key, size_t size, int shmflg)
ret = shm_reserve(key, shmflg);
if (ret < 0)
{
shmerr("shm_reserve failed: %d\n", ret);
shmerr("ERROR: shm_reserve failed: %d\n", ret);
return ret;
}
@@ -400,7 +400,7 @@ int shmget(key_t key, size_t size, int shmflg)
ret = shm_create(key, size, shmflg);
if (ret < 0)
{
shmerr("shm_create failed: %d\n", ret);
shmerr("ERROR: shm_create failed: %d\n", ret);
goto errout_with_semaphore;
}
@@ -443,7 +443,7 @@ int shmget(key_t key, size_t size, int shmflg)
ret = shm_extend(shmid, size);
if (ret < 0)
{
shmerr("shm_create failed: %d\n", ret);
shmerr("ERROR: shm_create failed: %d\n", ret);
goto errout_with_semaphore;
}
}