Remove error_description variable from strerr functions

This was suggested on this PR: https://github.com/ARMmbed/mbedtls/pull/3176

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav Aggarwal 2020-04-21 14:04:19 -07:00
parent 5cac337228
commit 8663c7415a
3 changed files with 258 additions and 516 deletions

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,6 @@ HEADER_INCLUDED
const char * mbedtls_high_level_strerr( int error_code )
{
int high_level_error_code;
const char *error_description = NULL;
if( error_code < 0 )
error_code = -error_code;
@ -63,13 +62,12 @@ HIGH_LEVEL_CODE_CHECKS
break;
}
return error_description;
return NULL;
}
const char * mbedtls_low_level_strerr( int error_code )
{
int low_level_error_code;
const char *error_description = NULL;
if( error_code < 0 )
error_code = -error_code;
@ -87,7 +85,7 @@ LOW_LEVEL_CODE_CHECKS
break;
}
return error_description;
return NULL;
}
void mbedtls_strerror( int ret, char *buf, size_t buflen )

View File

@ -161,8 +161,7 @@ foreach my $line (@matches)
}
${$code_check} .= "${white_space}case -($error_name):\n".
"${white_space} error_description = \"$module_name - $description\";\n".
"${white_space} break;\n"
"${white_space} return \"$module_name - $description\";\n"
};
if ($ll_old_define ne "")