Fix suspect DEBUGASSERT() like PR765

As pointed out by Şükrü Bahadır Arslan in PR765, function calls
inside DEBUGASSERT() will not be executed if DEBUGASSERT is
disabled. Following that PR, I searched for other instances of
similar errors and found four. As there are many thousands of
DEBUGASSERT in the code, this is *not* an exhaustive fix.

arch/arm/src/tms570/tms570_boot.c:
* In function arm_boot(), call tms570_memtest_complete()
  outside of the DEBUGASSERT(). Otherwise, if DEBUGASSERT is
  disabled, we will never rendezvous with completion of the
  test. (Two instances of this fix.)

arch/arm/src/tms570/tms570_clockconfig.c:
* In function tms570_clockconfig(), call
  tms570_efc_selftest_complete() outside of the DEBUGASSERT()
  for the same reason as above.

boards/arm/sam34/sam4s-xplained-pro/src/sam_boot.c:
* In function board_late_initialize(), call
  sam_watchdog_initialize() outside of the DEBUGASSERT() for
  the same reason as above.
This commit is contained in:
Nathan Hartman
2020-04-12 15:21:45 -04:00
committed by patacongo
parent 759d8c1bfa
commit 743dcd8acf
3 changed files with 20 additions and 5 deletions
@@ -89,7 +89,9 @@ void board_late_initialize(void)
#if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET))
/* Configure watchdog timer and enable kicker kernel thread. */
DEBUGASSERT(sam_watchdog_initialize() >= 0);
int check = sam_watchdog_initialize();
DEBUGASSERT(check >= 0);
UNUSED(check);
#endif
#ifndef CONFIG_ARCH_LEDS