change log for rtems (2010-08-23)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Aug 23 22:10:16 UTC 2010
*joel*:
2010-08-23 Joel Sherrill <joel.sherrill at oarcorp.com>
CID 99
CID 100
CID 101
CID 102
* libfs/src/dosfs/fat_file.c, libfs/src/dosfs/msdos.h,
libfs/src/dosfs/msdos_misc.c: Resolve invalid use of const identified
by Coverity scanner.
M 1.2580 cpukit/ChangeLog
M 1.16 cpukit/libfs/src/dosfs/fat_file.c
M 1.26 cpukit/libfs/src/dosfs/msdos.h
M 1.24 cpukit/libfs/src/dosfs/msdos_misc.c
diff -u rtems/cpukit/ChangeLog:1.2579 rtems/cpukit/ChangeLog:1.2580
--- rtems/cpukit/ChangeLog:1.2579 Mon Aug 23 11:10:53 2010
+++ rtems/cpukit/ChangeLog Mon Aug 23 16:29:31 2010
@@ -1,3 +1,13 @@
+2010-08-23 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ CID 99
+ CID 100
+ CID 101
+ CID 102
+ * libfs/src/dosfs/fat_file.c, libfs/src/dosfs/msdos.h,
+ libfs/src/dosfs/msdos_misc.c: Resolve invalid use of const identified
+ by Coverity scanner.
+
2010-08-23 Sebastian Huber <sebastian.huber at embedded-brains.de>
PR 1673/cpukit
diff -u rtems/cpukit/libfs/src/dosfs/fat_file.c:1.15 rtems/cpukit/libfs/src/dosfs/fat_file.c:1.16
--- rtems/cpukit/libfs/src/dosfs/fat_file.c:1.15 Sun Nov 29 07:18:56 2009
+++ rtems/cpukit/libfs/src/dosfs/fat_file.c Mon Aug 23 16:29:31 2010
@@ -691,22 +691,25 @@
ret = va_arg(ap, uint32_t *);
/* sanity check */
- if ( pos >= fat_fd->fat_file_size )
+ if ( pos >= fat_fd->fat_file_size ) {
+ va_end();
rtems_set_errno_and_return_minus_one( EIO );
+ }
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
/* cluster 0 (zero) reserved for root dir */
*ret = 0;
- return RC_OK;
+ rc = RC_OK;
+ break;
}
cl_start = pos >> fs_info->vol.bpc_log2;
rc = fat_file_lseek(mt_entry, fat_fd, cl_start, &cur_cln);
if ( rc != RC_OK )
- return rc;
+ break;
*ret = cur_cln;
break;
@@ -716,6 +719,7 @@
rc = -1;
break;
}
+ va_end(ap);
return rc;
}
diff -u rtems/cpukit/libfs/src/dosfs/msdos.h:1.25 rtems/cpukit/libfs/src/dosfs/msdos.h:1.26
--- rtems/cpukit/libfs/src/dosfs/msdos.h:1.25 Thu Jul 15 02:36:37 2010
+++ rtems/cpukit/libfs/src/dosfs/msdos.h Mon Aug 23 16:29:31 2010
@@ -179,8 +179,8 @@
#define MSDOS_NAME_MAX_LFN_WITH_DOT (260)
-extern const char const* MSDOS_DOT_NAME; /* ".", padded to MSDOS_NAME chars */
-extern const char const* MSDOS_DOTDOT_NAME; /* ".", padded to MSDOS_NAME chars */
+extern const char *const MSDOS_DOT_NAME; /* ".", padded to MSDOS_NAME chars */
+extern const char *const MSDOS_DOTDOT_NAME; /* ".", padded to MSDOS_NAME chars */
typedef enum msdos_name_types_e
{
diff -u rtems/cpukit/libfs/src/dosfs/msdos_misc.c:1.23 rtems/cpukit/libfs/src/dosfs/msdos_misc.c:1.24
--- rtems/cpukit/libfs/src/dosfs/msdos_misc.c:1.23 Tue Mar 30 06:16:29 2010
+++ rtems/cpukit/libfs/src/dosfs/msdos_misc.c Mon Aug 23 16:29:31 2010
@@ -40,8 +40,8 @@
/*
* External strings. Saves spave this way.
*/
-const char const* MSDOS_DOT_NAME = ". ";
-const char const* MSDOS_DOTDOT_NAME = ".. ";
+const char *const MSDOS_DOT_NAME = ". ";
+const char *const MSDOS_DOTDOT_NAME = ".. ";
/* msdos_is_valid_name_char --
* Routine to check the character in a file or directory name.
*joel*:
2010-08-23 Joel Sherrill <joel.sherrill at oarcorp.com>
CID 79/DEADCODE
CID 78/DEADCODE
CID 77/DEADCODE
CID 76/DEADCODE
* posix/src/condtimedwait.c, posix/src/mutextimedlock.c,
posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
posix/src/semtimedwait.c: Resolve various dead code issues identified
by Coverity scanner.
M 1.2581 cpukit/ChangeLog
M 1.9 cpukit/posix/src/condtimedwait.c
M 1.12 cpukit/posix/src/mutextimedlock.c
M 1.12 cpukit/posix/src/prwlocktimedrdlock.c
M 1.11 cpukit/posix/src/prwlocktimedwrlock.c
M 1.15 cpukit/posix/src/semtimedwait.c
diff -u rtems/cpukit/ChangeLog:1.2580 rtems/cpukit/ChangeLog:1.2581
--- rtems/cpukit/ChangeLog:1.2580 Mon Aug 23 16:29:31 2010
+++ rtems/cpukit/ChangeLog Mon Aug 23 16:31:26 2010
@@ -1,5 +1,17 @@
2010-08-23 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ CID 79/DEADCODE
+ CID 78/DEADCODE
+ CID 77/DEADCODE
+ CID 76/DEADCODE
+ * posix/src/condtimedwait.c, posix/src/mutextimedlock.c,
+ posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
+ posix/src/semtimedwait.c: Resolve various dead code issues identified
+ by Coverity scanner.
+
+2010-08-23 Joel Sherrill <joel.sherrill at oarcorp.com>
+
CID 99
CID 100
CID 101
diff -u rtems/cpukit/posix/src/condtimedwait.c:1.8 rtems/cpukit/posix/src/condtimedwait.c:1.9
--- rtems/cpukit/posix/src/condtimedwait.c:1.8 Sun May 3 18:10:02 2009
+++ rtems/cpukit/posix/src/condtimedwait.c Mon Aug 23 16:31:27 2010
@@ -39,8 +39,9 @@
const struct timespec *abstime
)
{
- Watchdog_Interval ticks;
- bool already_timedout;
+ Watchdog_Interval ticks;
+ bool already_timedout;
+ POSIX_Absolute_timeout_conversion_results_t status;
/*
* POSIX requires that blocking calls with timeouts that take
@@ -51,18 +52,14 @@
* then we do a polling operation and convert the UNSATISFIED
* status into the appropriate error.
*/
- switch ( _POSIX_Absolute_timeout_to_ticks(abstime, &ticks) ) {
- case POSIX_ABSOLUTE_TIMEOUT_INVALID:
- return EINVAL;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
- case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
- already_timedout = true;
- break;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
- default: /* only to silence warnings */
- already_timedout = false;
- break;
- }
+ already_timedout = false;
+ status = _POSIX_Absolute_timeout_to_ticks(abstime, &ticks);
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
+ return EINVAL;
+
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
+ status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
+ already_timedout = true;
return _POSIX_Condition_variables_Wait_support(
cond,
diff -u rtems/cpukit/posix/src/mutextimedlock.c:1.11 rtems/cpukit/posix/src/mutextimedlock.c:1.12
--- rtems/cpukit/posix/src/mutextimedlock.c:1.11 Mon Nov 30 09:44:21 2009
+++ rtems/cpukit/posix/src/mutextimedlock.c Mon Aug 23 16:31:27 2010
@@ -72,15 +72,11 @@
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
- switch (lock_status) {
- case POSIX_ABSOLUTE_TIMEOUT_INVALID:
- return EINVAL;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
- case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
- return ETIMEDOUT;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
- break;
- }
+ if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
+ return EINVAL;
+ if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
+ lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
+ return ETIMEDOUT;
}
return lock_status;
diff -u rtems/cpukit/posix/src/prwlocktimedrdlock.c:1.11 rtems/cpukit/posix/src/prwlocktimedrdlock.c:1.12
--- rtems/cpukit/posix/src/prwlocktimedrdlock.c:1.11 Mon Nov 30 09:44:21 2009
+++ rtems/cpukit/posix/src/prwlocktimedrdlock.c Mon Aug 23 16:31:27 2010
@@ -82,15 +82,11 @@
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
- switch (status) {
- case POSIX_ABSOLUTE_TIMEOUT_INVALID:
- return EINVAL;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
- case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
- return ETIMEDOUT;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
- break;
- }
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
+ return EINVAL;
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
+ status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
+ return ETIMEDOUT;
}
}
diff -u rtems/cpukit/posix/src/prwlocktimedwrlock.c:1.10 rtems/cpukit/posix/src/prwlocktimedwrlock.c:1.11
--- rtems/cpukit/posix/src/prwlocktimedwrlock.c:1.10 Mon Nov 30 09:44:21 2009
+++ rtems/cpukit/posix/src/prwlocktimedwrlock.c Mon Aug 23 16:31:27 2010
@@ -82,15 +82,11 @@
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
- switch (status) {
- case POSIX_ABSOLUTE_TIMEOUT_INVALID:
- return EINVAL;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
- case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
- return ETIMEDOUT;
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
- break;
- }
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
+ return EINVAL;
+ if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
+ status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
+ return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
diff -u rtems/cpukit/posix/src/semtimedwait.c:1.14 rtems/cpukit/posix/src/semtimedwait.c:1.15
--- rtems/cpukit/posix/src/semtimedwait.c:1.14 Mon Jun 21 11:38:26 2010
+++ rtems/cpukit/posix/src/semtimedwait.c Mon Aug 23 16:31:27 2010
@@ -70,15 +70,11 @@
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
- switch (lock_status) {
- case POSIX_ABSOLUTE_TIMEOUT_INVALID:
- rtems_set_errno_and_return_minus_one( EINVAL );
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST:
- case POSIX_ABSOLUTE_TIMEOUT_IS_NOW:
- rtems_set_errno_and_return_minus_one( ETIMEDOUT );
- case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
- break;
- }
+ if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ if ( lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
+ lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
+ rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
return lock_status;
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100823/01e08c73/attachment-0001.html>
More information about the vc
mailing list