summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/tasksetscheduler.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/tasksetscheduler.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/tasksetscheduler.c')
-rw-r--r--cpukit/rtems/src/tasksetscheduler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/rtems/src/tasksetscheduler.c b/cpukit/rtems/src/tasksetscheduler.c
index 3a860a197b..f3b7143d7b 100644
--- a/cpukit/rtems/src/tasksetscheduler.c
+++ b/cpukit/rtems/src/tasksetscheduler.c
@@ -35,7 +35,8 @@ rtems_status_code rtems_task_set_scheduler(
Priority_Control core_priority;
Status_Control status;
- if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
+ scheduler = _Scheduler_Get_by_id( scheduler_id );
+ if ( scheduler == NULL ) {
return RTEMS_INVALID_ID;
}