summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskgetpriority.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 06:36:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-09 15:27:29 +0100
commit2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5 (patch)
treef27e6300271c5a5d47f6ef41a6d5c4780b715fc7 /cpukit/rtems/src/taskgetpriority.c
parentscore: Fix _MRSP_Initialize() (diff)
downloadrtems-2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5.tar.bz2
score: Simplify _Scheduler_Get_by_id()
Avoid dead code in non-SMP configurations. Return scheduler identifier independent of the current processor count of the scheduler via rtems_scheduler_ident(), since this value may change during run-time. Check the processor count in _Scheduler_Set() under scheduler lock protection. Update #2797.
Diffstat (limited to 'cpukit/rtems/src/taskgetpriority.c')
-rw-r--r--cpukit/rtems/src/taskgetpriority.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/rtems/src/taskgetpriority.c b/cpukit/rtems/src/taskgetpriority.c
index b6800e2133..8fb8ad3b4f 100644
--- a/cpukit/rtems/src/taskgetpriority.c
+++ b/cpukit/rtems/src/taskgetpriority.c
@@ -36,7 +36,8 @@ rtems_status_code rtems_task_get_priority(
return RTEMS_INVALID_ADDRESS;
}
- if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
+ scheduler = _Scheduler_Get_by_id( scheduler_id );
+ if ( scheduler == NULL ) {
return RTEMS_INVALID_ID;
}