summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/timerserver.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-14 17:37:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-14 17:37:12 +0000
commit115fb761dc2b2be70de70c80d2c5c88370bec963 (patch)
treeaf628913c22d9edf44e150c9251455ad74b37d5d /cpukit/rtems/src/timerserver.c
parent2007-12-14 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-115fb761dc2b2be70de70c80d2c5c88370bec963.tar.bz2
2007-12-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* 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.
Diffstat (limited to 'cpukit/rtems/src/timerserver.c')
-rw-r--r--cpukit/rtems/src/timerserver.c11
1 files changed, 7 insertions, 4 deletions
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.