diff --git a/include/psa/crypto.h b/include/psa/crypto.h index c58d22ae41..5be1b515fb 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -57,20 +57,6 @@ extern "C" { * @{ */ -#if defined(PSA_SUCCESS) -/* If PSA_SUCCESS is defined, assume that PSA crypto is being used - * together with PSA IPC, which also defines the identifier - * PSA_SUCCESS. We must not define PSA_SUCCESS ourselves in that case; - * the other error code names don't clash. Also define psa_status_t as - * an alias for the type used by PSA IPC. This is a temporary hack - * until we unify error reporting in PSA IPC and PSA crypto. - * - * Note that psa_defs.h must be included before this header! - */ -typedef psa_error_t psa_status_t; - -#else /* defined(PSA_SUCCESS) */ - /** * \brief Function return status. * @@ -80,9 +66,17 @@ typedef psa_error_t psa_status_t; */ typedef int32_t psa_status_t; +#if !defined(PSA_SUCCESS) +/* If PSA_SUCCESS is defined, assume that PSA crypto is being used + * together with PSA IPC, which also defines the identifier + * PSA_SUCCESS. We must not define PSA_SUCCESS ourselves in that case; + * the other error code names don't clash. This is a temporary hack + * until we unify error reporting in PSA IPC and PSA crypto. + * + * Note that psa_defs.h must be included before this header! + */ /** The action was completed successfully. */ #define PSA_SUCCESS ((psa_status_t)0) - #endif /* !defined(PSA_SUCCESS) */ /** An error occurred that does not correspond to any defined