From 115fb761dc2b2be70de70c80d2c5c88370bec963 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 14 Dec 2007 17:37:12 +0000 Subject: 2007-12-14 Joel Sherrill * posix/src/sleep.c, posix/src/usleep.c: Add copyright header. * rtems/src/ratemonreportstatistics.c, rtems/src/timerserver.c: Minor cleanup to improve testability and eliminate dead code. --- cpukit/ChangeLog | 6 ++++++ cpukit/posix/src/sleep.c | 7 +++++++ cpukit/posix/src/usleep.c | 9 ++++++++- cpukit/rtems/src/ratemonreportstatistics.c | 6 ++++-- cpukit/rtems/src/timerserver.c | 11 +++++++---- 5 files changed, 32 insertions(+), 7 deletions(-) (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b5fbd2e7ad..855755f582 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2007-12-14 Joel Sherrill + + * posix/src/sleep.c, posix/src/usleep.c: Add copyright header. + * rtems/src/ratemonreportstatistics.c, rtems/src/timerserver.c: + Minor cleanup to improve testability and eliminate dead code. + 2007-12-12 Chris Johns * libblock/include/rtems/flashdisk.h, libblock/src/flashdisk.c: diff --git a/cpukit/posix/src/sleep.c b/cpukit/posix/src/sleep.c index b4670a96ce..961aa4b352 100644 --- a/cpukit/posix/src/sleep.c +++ b/cpukit/posix/src/sleep.c @@ -1,6 +1,13 @@ /* * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * * $Id$ */ diff --git a/cpukit/posix/src/usleep.c b/cpukit/posix/src/usleep.c index af09f2cdc8..67abc438a6 100644 --- a/cpukit/posix/src/usleep.c +++ b/cpukit/posix/src/usleep.c @@ -1,5 +1,12 @@ /* - * XXX 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 + * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. * * $Id$ */ diff --git a/cpukit/rtems/src/ratemonreportstatistics.c b/cpukit/rtems/src/ratemonreportstatistics.c index b26fce55ad..e8949f4b5e 100644 --- a/cpukit/rtems/src/ratemonreportstatistics.c +++ b/cpukit/rtems/src/ratemonreportstatistics.c @@ -114,8 +114,10 @@ ididididid NNNN ccccc mmmmmm X /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); - if ( status != RTEMS_SUCCESSFUL ) - continue; + #if defined(RTEMS_DEBUG) + if ( status != RTEMS_SUCCESSFUL ) + continue; + #endif name[ 0 ] = '\0'; diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c index af6910bd5a..01bb597f1c 100644 --- a/cpukit/rtems/src/timerserver.c +++ b/cpukit/rtems/src/timerserver.c @@ -149,14 +149,17 @@ rtems_status_code rtems_timer_initiate_server( rtems_task_priority _priority; /* - * Make sure the requested priority is valid. + * Make sure the requested priority is valid. The if is + * structured so we check it is invalid before looking for + * a specific invalid value as the default. */ _priority = priority; - if ( priority == RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) + if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { + if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) + return RTEMS_INVALID_PRIORITY; _priority = 0; - else if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) - return RTEMS_INVALID_PRIORITY; + } /* * Just to make sure the test versus create/start operation are atomic. -- cgit v1.2.3