Fix misc issues with unused parameters and check-names.sh

Fix unused parameter warnings when MBEDTLS_TEST_HOOKS is not enabled.

A few issues were caught by check-names.sh namely:

- mbedtls_error_add was not capitalised.
- mbedtls_test_hook_error_add was being defined multiple times as the
  definition was in a header.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
This commit is contained in:
Chris Jones 2021-04-01 17:40:03 +01:00
parent 7439209bcc
commit b7d02e0f15
4 changed files with 23 additions and 16 deletions

View file

@ -120,14 +120,14 @@ extern "C" {
* Wrapper function for mbedtls_err_add_ext(). See that function for
* more details.
*/
#define mbedtls_error_add( high, low ) \
#define MBEDTLS_ERROR_ADD( high, low ) \
mbedtls_error_add_ext( high, low, __FILE__, __LINE__ )
/**
* \brief Testing hook called before adding/combining two error codes together.
* Only used when invasive testing is enabled via MBEDTLS_TEST_HOOKS.
*/
void (*mbedtls_test_hook_error_add)( int, int, const char *, int );
extern void (*mbedtls_test_hook_error_add)( int, int, const char *, int );
/**
* \brief Combines a high-level and low-level error code together.
@ -150,6 +150,9 @@ static inline int mbedtls_error_add_ext( int high, int low,
if( *mbedtls_test_hook_error_add != NULL )
( *mbedtls_test_hook_error_add )( high, low, file, line );
#endif
(void)file;
(void)line;
return( high + low );
}