Rename mbedtls_a64_crypto_sha256_check_support() to mbedtls_a64_crypto_sha256_determine_support()
The Mbed TLS coding standard specifies that "check" functions must return 0 for success (i.e. feature present), while "has" functions should return 1 for true. Since we were using "check" to do the actual check, and "has" to get the cached value, having inverted values here would be confusing. Therefore, rename "check" to "determine", as that's what those functions are doing. Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
parent
b9987fc344
commit
7e7aba8c9d
1 changed files with 5 additions and 5 deletions
|
@ -68,12 +68,12 @@
|
|||
* MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT if no detection mechanism found
|
||||
*/
|
||||
#if defined(HWCAP_SHA2)
|
||||
static int mbedtls_a64_crypto_sha256_check_support( void )
|
||||
static int mbedtls_a64_crypto_sha256_determine_support( void )
|
||||
{
|
||||
return( ( getauxval( AT_HWCAP ) & HWCAP_SHA2 ) ? 1 : 0 );
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
static int mbedtls_a64_crypto_sha256_check_support( void )
|
||||
static int mbedtls_a64_crypto_sha256_determine_support( void )
|
||||
{
|
||||
return( 1 );
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ static int mbedtls_a64_crypto_sha256_check_support( void )
|
|||
#include <Windows.h>
|
||||
#include <processthreadsapi.h>
|
||||
|
||||
static int mbedtls_a64_crypto_sha256_check_support( void )
|
||||
static int mbedtls_a64_crypto_sha256_determine_support( void )
|
||||
{
|
||||
return( IsProcessorFeaturePresent( PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE ) ?
|
||||
1 : 0 );
|
||||
|
@ -107,7 +107,7 @@ static void sigill_handler( int signal )
|
|||
longjmp( return_from_sigill, 1 );
|
||||
}
|
||||
|
||||
static int mbedtls_a64_crypto_sha256_check_support( void )
|
||||
static int mbedtls_a64_crypto_sha256_determine_support( void )
|
||||
{
|
||||
struct sigaction old_action, new_action;
|
||||
|
||||
|
@ -519,7 +519,7 @@ static int mbedtls_a64_crypto_sha256_has_support( void )
|
|||
|
||||
if( !done )
|
||||
{
|
||||
supported = mbedtls_a64_crypto_sha256_check_support();
|
||||
supported = mbedtls_a64_crypto_sha256_determine_support();
|
||||
done = 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue