Fix parantheses on return and sizeof statements.
Used script:
```
import re
import sys
for arg in sys.argv[1:]:
print(arg)
with open(arg, 'r') as file:
content = file.read()
content = re.sub(r"return\s?\((?!.*\).*\()\s*\n?(.*)\n?\);", r"return \1;", \
content, flags = re.M)
content = re.sub(r"sizeof ([^\(][a-zA-Z0-9_\[\]]*)", r"sizeof(\1)",\
content, flags = re.M)
with open(arg, 'w') as file:
file.write(content)
```
Executed with:
` find . -regextype posix-egrep -regex ".*\.([hc]|fmt|function)" | xargs -L1 python script.py`
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h
index daef941..0bf9098 100644
--- a/include/psa/crypto_values.h
+++ b/include/psa/crypto_values.h
@@ -2094,7 +2094,7 @@
{
(void)unused;
- return( key_id );
+ return key_id ;
}
/** Compare two key identifiers.
@@ -2107,7 +2107,7 @@
static inline int mbedtls_svc_key_id_equal( mbedtls_svc_key_id_t id1,
mbedtls_svc_key_id_t id2 )
{
- return( id1 == id2 );
+ return id1 == id2 ;
}
/** Check whether a key identifier is null.
@@ -2118,7 +2118,7 @@
*/
static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key )
{
- return( key == 0 );
+ return key == 0 ;
}
#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
@@ -2161,7 +2161,7 @@
*/
static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key )
{
- return( key.MBEDTLS_PRIVATE(key_id) == 0 );
+ return key.MBEDTLS_PRIVATE(key_id) == 0 ;
}
#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */