The code assumed it could return HAL_OK, HAL_EINVAL and other HAL_STATUS types; so it shouldn't be declared as returning HAL_BOOL. This commit was brought to you by the Clang compiler. Submitted by: Matthew Fleming <mdf356@gmail.com>