Minor formatting tweaks
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/alignment.h b/library/alignment.h
index dedfdc9..e7f11da 100644
--- a/library/alignment.h
+++ b/library/alignment.h
@@ -33,10 +33,10 @@
* \param p pointer to 4 bytes of data
* \return Data at the given address
*/
-inline uint32_t mbedtls_get_unaligned_uint32( void const *p )
+inline uint32_t mbedtls_get_unaligned_uint32( const void *p )
{
uint32_t r;
- memcpy( &r, p, 4 );
+ memcpy( &r, p, sizeof( r ) );
return r;
}
@@ -49,7 +49,7 @@
*/
inline void mbedtls_put_unaligned_uint32( void *p, uint32_t x )
{
- memcpy( p, &x, 4 );
+ memcpy( p, &x, sizeof( x ) );
}
/** Byte Reading Macros
diff --git a/library/common.h b/library/common.h
index c175064..2cc44fb 100644
--- a/library/common.h
+++ b/library/common.h
@@ -86,7 +86,7 @@
* \param b Pointer to input (buffer of at least \p n bytes)
* \param n Number of bytes to process.
*/
-inline void mbedtls_xor( unsigned char *r, unsigned char const *a, unsigned char const *b, size_t n )
+inline void mbedtls_xor( unsigned char *r, const unsigned char *a, const unsigned char *b, size_t n )
{
size_t i;
for ( i = 0; ( i + 4 ) <= n; i += 4 )
diff --git a/tests/suites/test_suite_common.function b/tests/suites/test_suite_common.function
index c8a7a52..4444a52 100644
--- a/tests/suites/test_suite_common.function
+++ b/tests/suites/test_suite_common.function
@@ -82,9 +82,9 @@
ASSERT_COMPARE( r1 + r_off, n, r2 + r_off, n );
}
exit:
- if ( a != NULL ) mbedtls_free( a );
- if ( a != NULL ) mbedtls_free( b );
- if ( r1 != NULL ) mbedtls_free( r1 );
- if ( r2 != NULL ) mbedtls_free( r2 );
+ mbedtls_free( a );
+ mbedtls_free( b );
+ mbedtls_free( r1 );
+ mbedtls_free( r2 );
}
/* END_CASE */