From 2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 2 Nov 2016 06:36:13 +0100 Subject: 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. --- cpukit/rtems/src/taskgetpriority.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpukit/rtems/src/taskgetpriority.c') 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; } -- cgit v1.2.3