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_struct.h b/include/psa/crypto_struct.h
index 381abf9..ae732c3 100644
--- a/include/psa/crypto_struct.h
+++ b/include/psa/crypto_struct.h
@@ -93,7 +93,7 @@
static inline struct psa_hash_operation_s psa_hash_operation_init( void )
{
const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
- return( v );
+ return v ;
}
struct psa_cipher_operation_s
@@ -118,7 +118,7 @@
static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
{
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
- return( v );
+ return v ;
}
/* Include the context definition for the compiled-in drivers for the composite
@@ -143,7 +143,7 @@
static inline struct psa_mac_operation_s psa_mac_operation_init( void )
{
const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
- return( v );
+ return v ;
}
struct psa_aead_operation_s
@@ -164,7 +164,7 @@
static inline struct psa_aead_operation_s psa_aead_operation_init( void )
{
const struct psa_aead_operation_s v = PSA_AEAD_OPERATION_INIT;
- return( v );
+ return v ;
}
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)
@@ -251,7 +251,7 @@
void )
{
const struct psa_key_derivation_s v = PSA_KEY_DERIVATION_OPERATION_INIT;
- return( v );
+ return v ;
}
struct psa_key_policy_s
@@ -266,7 +266,7 @@
static inline struct psa_key_policy_s psa_key_policy_init( void )
{
const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
- return( v );
+ return v ;
}
/* The type used internally for key sizes.
@@ -339,7 +339,7 @@
static inline struct psa_key_attributes_s psa_key_attributes_init( void )
{
const struct psa_key_attributes_s v = PSA_KEY_ATTRIBUTES_INIT;
- return( v );
+ return v ;
}
static inline void psa_set_key_id( psa_key_attributes_t *attributes,