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_db.h b/secure_fw/spm/spm_db.h
index 6e6e25c..a3af8be 100644
--- a/secure_fw/spm/spm_db.h
+++ b/secure_fw/spm/spm_db.h
@@ -22,17 +22,13 @@
 #define TFM_PARTITION_TYPE_PSA   "PSA-ROT"
 
 #ifdef TFM_PSA_API
-enum tfm_partition_priority {
-    TFM_PRIORITY_LOW = THRD_PRIOR_LOWEST,
-    TFM_PRIORITY_NORMAL = THRD_PRIOR_MEDIUM,
-    TFM_PRIORITY_HIGH = THRD_PRIOR_HIGHEST,
-};
+#define TFM_PRIORITY_LOW    THRD_PRIOR_LOWEST
+#define TFM_PRIORITY_NORMAL THRD_PRIOR_MEDIUM
+#define TFM_PRIORITY_HIGH   THRD_PRIOR_HIGHEST
 #else
-enum tfm_partition_priority {
-    TFM_PRIORITY_LOW = 0xFF,
-    TFM_PRIORITY_NORMAL = 0x7F,
-    TFM_PRIORITY_HIGH = 0,
-};
+#define TFM_PRIORITY_LOW    0xFF
+#define TFM_PRIORITY_NORMAL 0x7F
+#define TFM_PRIORITY_HIGH   0
 #endif
 
 #define TFM_PRIORITY(LEVEL)      TFM_PRIORITY_##LEVEL