diff --git a/drivers/wireless/cc3000/cc3000.c b/drivers/wireless/cc3000/cc3000.c index 2c113b4f28..63b5d98cc9 100644 --- a/drivers/wireless/cc3000/cc3000.c +++ b/drivers/wireless/cc3000/cc3000.c @@ -687,7 +687,7 @@ static void * cc3000_worker(FAR void *arg) * Will it fit? */ - if (data_to_recv >= priv->rx_buffer_max_len + if (data_to_recv >= priv->rx_buffer_max_len) { lowsyslog(LOG_INFO, "data_to_recv %d", data_to_recv); } diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index 1048954364..fd05edbc6b 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -96,7 +96,7 @@ static void aio_read_worker(FAR void *arg) #ifdef CONFIG_PRIORITY_INHERITANCE uint8_t prio; #endif - ssize_t nread; + ssize_t nread = 0; /* Get the information from the container, decant the AIO control block, * and free the container before starting any I/O. That will minimize diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index f05e357c33..6b89038950 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -113,8 +113,10 @@ static void aio_write_worker(FAR void *arg) #ifdef CONFIG_PRIORITY_INHERITANCE uint8_t prio; #endif - ssize_t nwritten; + ssize_t nwritten = 0; +#ifdef AIO_HAVE_FILEP int oflags; +#endif /* Get the information from the container, decant the AIO control block, * and free the container before starting any I/O. That will minimize diff --git a/fs/fat/fs_configfat.c b/fs/fat/fs_configfat.c index 5aff493c90..59e174ef58 100644 --- a/fs/fat/fs_configfat.c +++ b/fs/fat/fs_configfat.c @@ -950,7 +950,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt, { /* There must be reserved sectors in order to have a backup boot sector */ - if (fmt->ff_rsvdseccount > 0 && fmt->ff_rsvdseccount >= 2) + if (fmt->ff_rsvdseccount >= 2) { /* Sector 0 is the MBR; 1... ff_rsvdseccount are reserved. Try the next * the last reserved sector. diff --git a/fs/nxffs/nxffs_dump.c b/fs/nxffs/nxffs_dump.c index 181aaaebed..19e4d4b5ce 100644 --- a/fs/nxffs/nxffs_dump.c +++ b/fs/nxffs/nxffs_dump.c @@ -67,7 +67,9 @@ struct nxffs_blkinfo_s off_t nblocks; off_t block; off_t offset; +#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_FS) bool verbose; +#endif }; /**************************************************************************** diff --git a/fs/nxffs/nxffs_initialize.c b/fs/nxffs/nxffs_initialize.c index 3fb9e2b775..d7d55f077a 100644 --- a/fs/nxffs/nxffs_initialize.c +++ b/fs/nxffs/nxffs_initialize.c @@ -410,7 +410,7 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume) if (!noinodes) { - while ((ret = nxffs_nextentry(volume, offset, &entry)) == OK) + while (nxffs_nextentry(volume, offset, &entry) == OK) { /* Discard the entry and guess the next offset. */ diff --git a/fs/smartfs/smartfs_procfs.c b/fs/smartfs/smartfs_procfs.c index 2b56f366d9..e74d659447 100644 --- a/fs/smartfs/smartfs_procfs.c +++ b/fs/smartfs/smartfs_procfs.c @@ -709,7 +709,9 @@ static size_t smartfs_status_read(FAR struct file *filep, FAR char *buffer, FAR struct smartfs_file_s *priv; int ret; size_t len; +#if 0 /* Not used */ int utilization; +#endif priv = (FAR struct smartfs_file_s *) filep->f_priv; @@ -729,6 +731,7 @@ static size_t smartfs_status_read(FAR struct file *filep, FAR char *buffer, if (ret == OK) { +#if 0 /* Not used */ /* Calculate the sector utilization percentage */ if (procfs_data.blockerases == 0) @@ -741,6 +744,7 @@ static size_t smartfs_status_read(FAR struct file *filep, FAR char *buffer, procfs_data.unusedsectors) / (procfs_data.blockerases * procfs_data.sectorsperblk); } +#endif /* Format and return data in the buffer */ @@ -756,8 +760,10 @@ static size_t smartfs_status_read(FAR struct file *filep, FAR char *buffer, procfs_data.formatsector, procfs_data.dirsector, procfs_data.freesectors, procfs_data.releasesectors, procfs_data.sectorsperblk); - //procfs_data.unusedsectors, procfs_data.blockerases, - //procfs_data.sectorsperblk, utilization); +#if 0 /* Not used */ + procfs_data.unusedsectors, procfs_data.blockerases, + procfs_data.sectorsperblk, utilization); +#endif } /* Indicate we have already provided all the data */ diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index bcbda7de8e..0b9a373b15 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -1441,7 +1441,7 @@ static int smartfs_unbind(void *handle, FAR struct inode **blkdriver) static int smartfs_statfs(struct inode *mountpt, struct statfs *buf) { struct smartfs_mountpt_s *fs; - int ret = OK; + int ret; /* Sanity checks */ @@ -1483,11 +1483,11 @@ static int smartfs_statfs(struct inode *mountpt, struct statfs *buf) static int smartfs_unlink(struct inode *mountpt, const char *relpath) { - struct smartfs_mountpt_s *fs; - int ret = OK; - struct smartfs_entry_s entry; - const char *filename; - uint16_t parentdirsector; + struct smartfs_mountpt_s *fs; + int ret; + struct smartfs_entry_s entry; + const char *filename; + uint16_t parentdirsector; /* Sanity checks */ @@ -1627,11 +1627,11 @@ errout_with_semaphore: int smartfs_rmdir(struct inode *mountpt, const char *relpath) { - struct smartfs_mountpt_s *fs; - int ret = OK; - struct smartfs_entry_s entry; - const char *filename; - uint16_t parentdirsector; + struct smartfs_mountpt_s *fs; + int ret; + struct smartfs_entry_s entry; + const char *filename; + uint16_t parentdirsector; /* Sanity checks */ @@ -1916,7 +1916,7 @@ static int smartfs_stat(struct inode *mountpt, const char *relpath, struct stat { struct smartfs_mountpt_s *fs; struct smartfs_entry_s entry; - int ret = -ENOENT; + int ret; uint16_t parentdirsector; const char *filename; diff --git a/libc/net/lib_inetpton.c b/libc/net/lib_inetpton.c index 2805a70476..8b058e044b 100644 --- a/libc/net/lib_inetpton.c +++ b/libc/net/lib_inetpton.c @@ -147,7 +147,7 @@ int inet_pton(int af, FAR const char *src, FAR void *dst) break; } - if (numoffset <= 0) + if (numoffset < 1) { /* Empty numeric string */ @@ -245,7 +245,7 @@ int inet_pton(int af, FAR const char *src, FAR void *dst) break; } - if (ch != '\0' && numoffset <= 0) + if (ch != '\0' && numoffset < 1) { /* Empty numeric string */ diff --git a/libc/stdio/lib_lowinstream.c b/libc/stdio/lib_lowinstream.c index 7284601e8e..8c11fee907 100644 --- a/libc/stdio/lib_lowinstream.c +++ b/libc/stdio/lib_lowinstream.c @@ -65,7 +65,7 @@ static int lowinstream_getc(FAR struct lib_instream_s *this) /* Get the next character from the incoming stream */ - ret = up_getc(ch) + ret = up_getc(ch); if (ret != EOF) { this->nget++; diff --git a/libc/stdlib/lib_mkstemp.c b/libc/stdlib/lib_mkstemp.c index 729dfa5354..94b6dcc0af 100644 --- a/libc/stdlib/lib_mkstemp.c +++ b/libc/stdlib/lib_mkstemp.c @@ -149,9 +149,7 @@ static void incr_base62(void) static void get_base62(FAR uint8_t *ptr) { - int ret; - - while ((ret = sem_wait(&g_b62sem)) < 0) + while (sem_wait(&g_b62sem) < 0) { DEBUGASSERT(errno == EINTR); } diff --git a/libc/stdlib/lib_qsort.c b/libc/stdlib/lib_qsort.c index 0579b15100..0ce30e9997 100644 --- a/libc/stdlib/lib_qsort.c +++ b/libc/stdlib/lib_qsort.c @@ -213,6 +213,7 @@ loop: swap(pl, pl - size); } } + return; } @@ -230,6 +231,7 @@ loop: if ((r = pd - pc) > size) { /* Iterate rather than recurse to save stack space */ + base = pn - r; nmemb = r / size; goto loop; diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 20b1916c8b..9890e5712c 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -91,7 +91,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) /* Handle bad sizes */ - if (size <= 0) + if (size < 1) { return NULL; } diff --git a/mm/mm_heap/mm_realloc.c b/mm/mm_heap/mm_realloc.c index f41d019b5e..5778975f50 100644 --- a/mm/mm_heap/mm_realloc.c +++ b/mm/mm_heap/mm_realloc.c @@ -101,7 +101,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, /* If size is zero, then realloc is equivalent to free */ - if (size <= 0) + if (size < 1) { mm_free(heap, oldmem); return NULL; @@ -170,7 +170,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, * previous chunk is smaller than the next chunk. */ - if (prevsize > 0 && (nextsize >= prevsize || nextsize <= 0)) + if (prevsize > 0 && (nextsize >= prevsize || nextsize < 1)) { /* Can we get everything we need from the previous chunk? */