Build: Major warnings cleanup

This is a major type-mismatch cleanup and warnings elimination.

The IAR toolchain runs with more warnings enabled than ARMCLANG or
GNUARM, which has resulted in this effort.

This should make it easier to enable "pedantic" mode also for GNUARM.

There are still a few warnings about jumping past variable
initialization and falling off the end of non-void functions, but there
are comments in some of these parts that implies that this is done to
catch programming errors, like having case labels for all possible enum
values.

Reordered initializer in tfm_attestation_req_mngr.c to eliminate CI
warning.

Disabled "Pe940" warnings in CommonConfig.cmake to suppress warnings
about inline assembly functions declared to return value that doesn't
declare a return value in the __ASM() statement.

Disabled "Pe546" warnings to supress warnings about jumping over
unused initializers.

Fixed what appears to be a copy/paste bug in tfm_ss_core_test.c.

Removed unused variable "ret" in Driver_PPC.c for AN519 and AN521, to
make it similar to AN524.

Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: I2b729c73e4b004cff6b0530cc1350fcf900e4272
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index b3acd55..743ce1d 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -113,7 +113,7 @@
                                         const uint32_t sfn_id)
 {
     psa_status_t status = PSA_SUCCESS;
-    size_t in_len = PSA_MAX_IOVEC, out_len = PSA_MAX_IOVEC, i, read_size;
+    size_t in_len = PSA_MAX_IOVEC, out_len = PSA_MAX_IOVEC, i;
     psa_invec in_vec[PSA_MAX_IOVEC] = { {0} };
     psa_outvec out_vec[PSA_MAX_IOVEC] = { {0} };
     void *alloc_buf_ptr = NULL;
@@ -140,7 +140,7 @@
             return status;
         }
         /* Read from the IPC framework inputs into the scratch */
-        read_size = psa_read(msg->handle, i, alloc_buf_ptr, msg->in_size[i]);
+        (void) psa_read(msg->handle, i, alloc_buf_ptr, msg->in_size[i]);
         /* Populate the fields of the input to the secure function */
         in_vec[i].base = alloc_buf_ptr;
         in_vec[i].len = msg->in_size[i];
@@ -258,7 +258,7 @@
         }
     }
 
-    /* This is unreachable */
+    /* NOTREACHED */
     return;
 }
 #endif /* TFM_PSA_API */