From 5dffbc424e7aac75e3704418c7d5a8b94cdd5ac8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 16 May 2022 20:34:59 +0200 Subject: score: Make SMP only code explicit Conditional expressions with inline functions are not optimized away if optimization is disabled. Avoid such expressions to prevent dead branches. It helps also during code review to immediately see if a loop is used or not. --- cpukit/score/src/watchdogtick.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpukit/score/src/watchdogtick.c') diff --git a/cpukit/score/src/watchdogtick.c b/cpukit/score/src/watchdogtick.c index 6edb3f071a..71311b598e 100644 --- a/cpukit/score/src/watchdogtick.c +++ b/cpukit/score/src/watchdogtick.c @@ -83,9 +83,13 @@ void _Watchdog_Tick( Per_CPU_Control *cpu ) Thread_Control *executing; const Thread_CPU_budget_operations *cpu_budget_operations; +#ifdef RTEMS_SMP if ( _Per_CPU_Is_boot_processor( cpu ) ) { +#endif ++_Watchdog_Ticks_since_boot; +#ifdef RTEMS_SMP } +#endif _ISR_lock_ISR_disable_and_acquire( &cpu->Watchdog.Lock, &lock_context ); -- cgit v1.2.3