From 77e6eba7146ba2e2074b719eec01cc7c40bbe98b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 7 Mar 2016 16:01:57 +0100 Subject: score: Add and use _Objects_Get_local() This simplifies the handling with local-only objects. Update #2555. --- cpukit/rtems/src/timercancel.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'cpukit/rtems/src/timercancel.c') diff --git a/cpukit/rtems/src/timercancel.c b/cpukit/rtems/src/timercancel.c index 5d4343e776..a69f38e72a 100644 --- a/cpukit/rtems/src/timercancel.c +++ b/cpukit/rtems/src/timercancel.c @@ -20,25 +20,17 @@ rtems_status_code rtems_timer_cancel( rtems_id id ) { - Timer_Control *the_timer; - Objects_Locations location; - ISR_lock_Context lock_context; - Per_CPU_Control *cpu; + Timer_Control *the_timer; + ISR_lock_Context lock_context; - the_timer = _Timer_Get( id, &location, &lock_context ); - switch ( location ) { + the_timer = _Timer_Get( id, &lock_context ); + if ( the_timer != NULL ) { + Per_CPU_Control *cpu; - case OBJECTS_LOCAL: - cpu = _Timer_Acquire_critical( the_timer, &lock_context ); - _Timer_Cancel( cpu, the_timer ); - _Timer_Release( cpu, &lock_context ); - return RTEMS_SUCCESSFUL; - -#if defined(RTEMS_MULTIPROCESSING) - case OBJECTS_REMOTE: /* should never return this */ -#endif - case OBJECTS_ERROR: - break; + cpu = _Timer_Acquire_critical( the_timer, &lock_context ); + _Timer_Cancel( cpu, the_timer ); + _Timer_Release( cpu, &lock_context ); + return RTEMS_SUCCESSFUL; } return RTEMS_INVALID_ID; -- cgit v1.2.3