Core: Improve code quality

This patch fixes the following things:
* avoid implicit casting by using matching types or casting
* avoid implicit casting between enum tfm_buffer_share_region_e and
uint32_t types by replacing the enumerated type with uint32_t and its
constants with preprocessor constants
* make explicit that the return value of a function is not used
* remove function return type if not needed
* replace preprocessor if condition by ifdef if only definition is
  checked
* replace enumerated types not used by preprocessor constants

Change-Id: Ib718937f89631cae2212de1fc748c48461b683d0
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
diff --git a/secure_fw/spm/spm_api.c b/secure_fw/spm/spm_api.c
index e138190..9b3f3f2 100644
--- a/secure_fw/spm/spm_api.c
+++ b/secure_fw/spm/spm_api.c
@@ -134,7 +134,7 @@
     part_ptr = &(g_spm_partition_db.partitions[
             g_spm_partition_db.partition_count]);
     part_ptr->static_data.partition_id = TFM_SP_NON_SECURE_ID;
-#if TFM_PSA_API
+#ifdef TFM_PSA_API
     part_ptr->static_data.partition_flags = SPM_PART_FLAG_APP_ROT |
                                             SPM_PART_FLAG_IPC;
     part_ptr->static_data.partition_priority = TFM_PRIORITY_LOW;
@@ -206,7 +206,7 @@
             desc.sfn = (sfn_t)part->static_data.partition_init;
             desc.sp_id = part->static_data.partition_id;
             res = tfm_core_sfn_request(&desc);
-            if (res == TFM_SUCCESS) {
+            if (res == (int32_t)TFM_SUCCESS) {
                 tfm_spm_partition_set_state(idx, SPM_PARTITION_STATE_IDLE);
             } else {
                 tfm_spm_partition_err_handler(part, TFM_INIT_FAILURE, res);