fix: implicitly casts

Change macros to include an explicit cast to type size_t.
This was being hinted by clang-tidy of clang-14.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I4af78fcf5e5f5793584082b0b9cb61e0a9ab8f26
diff --git a/inc/hf/mm.h b/inc/hf/mm.h
index f76990a..e416103 100644
--- a/inc/hf/mm.h
+++ b/inc/hf/mm.h
@@ -10,6 +10,7 @@
 
 #include <stdalign.h>
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
 
 #include "hf/arch/mm.h"
@@ -21,7 +22,7 @@
 /* Keep macro alignment */
 /* clang-format off */
 
-#define PAGE_SIZE (1 << PAGE_BITS)
+#define PAGE_SIZE ((size_t)(1 << PAGE_BITS))
 #define MM_PTE_PER_PAGE (PAGE_SIZE / sizeof(pte_t))
 
 /* The following are arch-independent page mapping modes. */
diff --git a/inc/hf/std.h b/inc/hf/std.h
index 4d8265a..3e37c3a 100644
--- a/inc/hf/std.h
+++ b/inc/hf/std.h
@@ -17,7 +17,7 @@
  * likely to catch errors. This may need to be relaxed if it proves to be overly
  * restrictive.
  */
-#define RSIZE_MAX (128 * 1024 * 1024)
+#define RSIZE_MAX ((size_t)(128 * 1024 * 1024))
 
 /*
  * Only the safer versions of these functions are exposed to reduce the chance
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 0bf05ae..4db2c14 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -144,7 +144,7 @@
  * be confused with PAGE_SIZE, which is the translation granule Hafnium is
  * configured to use.
  */
-#define FFA_PAGE_SIZE 4096
+#define FFA_PAGE_SIZE ((size_t)4096)
 
 /** The ID of a VM. These are assigned sequentially starting with an offset. */
 typedef uint16_t ffa_vm_id_t;
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index 5794fa2..6e2522d 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -41,10 +41,10 @@
 #define HF_SLEEP_INDEFINITE 0xffffffffffffffff
 
 /** The amount of data that can be sent to a mailbox. */
-#define HF_MAILBOX_SIZE 4096
+#define HF_MAILBOX_SIZE ((size_t)4096)
 
 /** Interrupt ID returned when there is no interrupt pending. */
-#define HF_INVALID_INTID 0xffffffff
+#define HF_INVALID_INTID ((ffa_vm_id_t)0xffffffff)
 
 /** Interrupt ID indicating the mailbox is readable. */
 #define HF_MAILBOX_READABLE_INTID 1
diff --git a/src/arch/aarch64/arm_smmuv3/arm_smmuv3.h b/src/arch/aarch64/arm_smmuv3/arm_smmuv3.h
index edd8bec..0e119a9 100644
--- a/src/arch/aarch64/arm_smmuv3/arm_smmuv3.h
+++ b/src/arch/aarch64/arm_smmuv3/arm_smmuv3.h
@@ -158,11 +158,11 @@
 #define PTM_SHIFT 2
 #define PTM_MASK 1
 
-#define CMD_SIZE 16
-#define CMD_SIZE_DW (CMD_SIZE / 8)
+#define CMD_SIZE ((size_t)(16))
+#define CMD_SIZE_DW ((size_t)(CMD_SIZE / 8))
 #define EVT_RECORD_SIZE 32
 #define STE_SIZE 64
-#define STE_SIZE_DW (STE_SIZE / 8)
+#define STE_SIZE_DW ((size_t)(STE_SIZE / 8))
 
 /* Global ByPass Attribute fields */
 #define BYPASS_GBPA 0