Use -1 as uninitialised marker
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
4566132163
commit
b30adce7fd
2 changed files with 4 additions and 4 deletions
|
@ -99,7 +99,7 @@
|
|||
#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
char mbedtls_aesce_has_support_result = 2;
|
||||
signed char mbedtls_aesce_has_support_result = -1;
|
||||
|
||||
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||
/*
|
||||
|
@ -113,7 +113,7 @@ int mbedtls_aesce_has_support_impl(void)
|
|||
* It is possible that we could end up setting result more than
|
||||
* once, but that is harmless.
|
||||
*/
|
||||
if (mbedtls_aesce_has_support_result == 2) {
|
||||
if (mbedtls_aesce_has_support_result == -1) {
|
||||
unsigned long auxval = getauxval(AT_HWCAP);
|
||||
if ((auxval & (HWCAP_ASIMD | HWCAP_AES)) ==
|
||||
(HWCAP_ASIMD | HWCAP_AES)) {
|
||||
|
|
|
@ -44,7 +44,7 @@ extern "C" {
|
|||
|
||||
#if defined(__linux__) && !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||
|
||||
extern char mbedtls_aesce_has_support_result;
|
||||
extern signed char mbedtls_aesce_has_support_result;
|
||||
|
||||
/**
|
||||
* \brief Internal function to detect the crypto extension in CPUs.
|
||||
|
@ -53,7 +53,7 @@ extern char mbedtls_aesce_has_support_result;
|
|||
*/
|
||||
int mbedtls_aesce_has_support_impl(void);
|
||||
|
||||
#define mbedtls_aesce_has_support() (mbedtls_aesce_has_support_result == 2 ? \
|
||||
#define mbedtls_aesce_has_support() (mbedtls_aesce_has_support_result == -1 ? \
|
||||
mbedtls_aesce_has_support_impl() : \
|
||||
mbedtls_aesce_has_support_result)
|
||||
|
||||
|
|
Loading…
Reference in a new issue