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/spm/spm_func.c b/secure_fw/spm/spm_func.c
index 6b9c46b..afb0479 100644
--- a/secure_fw/spm/spm_func.c
+++ b/secure_fw/spm/spm_func.c
@@ -411,7 +411,7 @@
     uint32_t handler_partition_id = svc_ctx->r0;
     sfn_t unpriv_handler = (sfn_t)svc_ctx->r1;
     uint32_t irq_signal = svc_ctx->r2;
-    uint32_t irq_line = svc_ctx->r3;
+    IRQn_Type irq_line = (IRQn_Type) svc_ctx->r3;
     enum tfm_status_e res;
     uint32_t psp = __get_PSP();
     uint32_t handler_partition_psp;
@@ -922,7 +922,7 @@
  * \retval >=0     The IRQ line number associated with a signal in the partition
  * \retval <0      error
  */
-static int32_t get_irq_line_for_signal(int32_t partition_id,
+static IRQn_Type get_irq_line_for_signal(int32_t partition_id,
                                        psa_signal_t signal)
 {
     size_t i;
@@ -933,7 +933,7 @@
             return tfm_core_irq_signals[i].irq_line;
         }
     }
-    return -1;
+    return (IRQn_Type) -1;
 }
 
 void tfm_spm_enable_irq_handler(uint32_t *svc_args)
@@ -945,7 +945,7 @@
                       tfm_spm_partition_get_running_partition_idx();
     uint32_t running_partition_id =
                       tfm_spm_partition_get_partition_id(running_partition_idx);
-    int32_t irq_line;
+    IRQn_Type irq_line;
 
     /* Only a single signal is allowed */
     if (!tfm_is_one_bit_set(irq_signal)) {
@@ -972,7 +972,7 @@
                       tfm_spm_partition_get_running_partition_idx();
     uint32_t running_partition_id =
                       tfm_spm_partition_get_partition_id(running_partition_idx);
-    int32_t irq_line;
+    IRQn_Type irq_line;
 
     /* Only a single signal is allowed */
     if (!tfm_is_one_bit_set(irq_signal)) {
@@ -1030,7 +1030,7 @@
     uint32_t running_partition_idx;
     uint32_t running_partition_id;
     const struct spm_partition_runtime_data_t *curr_part_data;
-    int32_t irq_line;
+    IRQn_Type irq_line;
 
     running_partition_idx = tfm_spm_partition_get_running_partition_idx();
     running_partition_id =