diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 43a45527968..ffce0f9bee6 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -181,7 +181,7 @@ static int uart_putxmitchar(FAR uart_dev_t *dev, int ch, bool oktoblock) dev->xmit.buffer[dev->xmit.head] = ch; dev->xmit.head = nexthead; - return OK; + break; } /* The TX buffer is full. Should be block, waiting for the hardware diff --git a/fs/vfs/fs_lseek.c b/fs/vfs/fs_lseek.c index 18c57e00b55..3bae28992ed 100644 --- a/fs/vfs/fs_lseek.c +++ b/fs/vfs/fs_lseek.c @@ -84,15 +84,13 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence) /* FALLTHROUGH */ case SEEK_SET: - if (offset >= 0) - { - filep->f_pos = offset; /* Might be beyond the end-of-file */ - break; - } - else + if (offset < 0) { return -EINVAL; } + + filep->f_pos = offset; /* Might be beyond the end-of-file */ + break; case SEEK_END: diff --git a/libs/libc/stdio/lib_fopen.c b/libs/libc/stdio/lib_fopen.c index d446e0960cb..50293282dbe 100644 --- a/libs/libc/stdio/lib_fopen.c +++ b/libs/libc/stdio/lib_fopen.c @@ -324,7 +324,6 @@ int lib_mode2oflags(FAR const char *mode) default: goto errout; - break; } break; @@ -401,7 +400,6 @@ int lib_mode2oflags(FAR const char *mode) default: goto errout; - break; } } diff --git a/libs/libc/string/lib_strcasestr.c b/libs/libc/string/lib_strcasestr.c index 369044253d3..9ccddaff167 100644 --- a/libs/libc/string/lib_strcasestr.c +++ b/libs/libc/string/lib_strcasestr.c @@ -92,7 +92,7 @@ FAR char *strcasestr(FAR const char *str, FAR const char *substr) * substring. */ - return NULL; + break; } /* Check if this is the beginning of a matching substring diff --git a/libs/libc/unistd/lib_getopt_common.c b/libs/libc/unistd/lib_getopt_common.c index be3e22a21a5..cede600c677 100644 --- a/libs/libc/unistd/lib_getopt_common.c +++ b/libs/libc/unistd/lib_getopt_common.c @@ -153,7 +153,6 @@ static int getopt_long_option(FAR struct getopt_s *go, default: goto errout; - break; } } else @@ -213,7 +212,6 @@ static int getopt_long_option(FAR struct getopt_s *go, default: goto errout; - break; } } diff --git a/libs/libc/wctype/lib_iswctype.c b/libs/libc/wctype/lib_iswctype.c index 235b8e18eca..034ea9b7991 100644 --- a/libs/libc/wctype/lib_iswctype.c +++ b/libs/libc/wctype/lib_iswctype.c @@ -147,7 +147,7 @@ int iswctype(wint_t c, wctype_t desc) return iswxdigit(c); default: - return 0; /* eliminate warning */ + break; /* eliminate warning */ } /* Otherwise unknown */