fix(runtime): clang-tidy macro parentheses warnings

This patch encloses macro arguments in brackets, as advised by the
clang-tidy bugprone-macro-parentheses check.

Signed-off-by: Chuyue Luo <Chuyue.Luo@arm.com>
Change-Id: Ic1e85bba46aa55fefd7c4df1b5e49f7909863697
diff --git a/runtime/core/handler.c b/runtime/core/handler.c
index 4190060..9e63651 100644
--- a/runtime/core/handler.c
+++ b/runtime/core/handler.c
@@ -67,7 +67,7 @@
  * [0:7]  - number of arguments
  * [8:15] - number of output values
  */
-#define RMI_TYPE(_in, _out)	(_in | (_out << 8))
+#define RMI_TYPE(_in, _out)	((_in) | ((_out) << 8))
 #define set_rmi_type(_in, _out)	rmi_type_##_in##_out = RMI_TYPE(_in, _out)
 
 enum rmi_type {
@@ -114,11 +114,11 @@
 #define RMI_HANDLER_ID(_id)	SMC64_FID_OFFSET_FROM_RANGE_MIN(RMI, _id)
 
 #define HANDLER(_id, _in, _out, _fn, _exec, _error)[RMI_HANDLER_ID(SMC_RMM_##_id)] = { \
-	.fn_name = #_id,		\
+	.fn_name = (#_id),		\
 	.type = RMI_TYPE(_in, _out),	\
-	.f_##_in##_out = _fn,		\
-	.log_exec = _exec,		\
-	.log_error = _error		\
+	.f_##_in##_out = (_fn),		\
+	.log_exec = (_exec),		\
+	.log_error = (_error)		\
 }
 
 /*
@@ -392,8 +392,8 @@
 };
 
 #define RMM_TRAP_HANDLER(_aborted_pc, _new_pc) \
-	{ .aborted_pc = (unsigned long)(&_aborted_pc), \
-	  .new_pc = (unsigned long)(&_new_pc) }
+	{ .aborted_pc = (unsigned long)(&(_aborted_pc)), \
+	  .new_pc = (unsigned long)(&(_new_pc)) }
 
 /*
  * The registered locations of load/store instructions that access NS memory.
diff --git a/runtime/core/sysregs.c b/runtime/core/sysregs.c
index a2d0362..516756a 100644
--- a/runtime/core/sysregs.c
+++ b/runtime/core/sysregs.c
@@ -247,7 +247,7 @@
 };
 
 #define SYSREG_HANDLER(_mask, _value, _handler_fn) \
-	{ .esr_mask = (_mask), .esr_value = (_value), .fn = _handler_fn }
+	{ .esr_mask = (_mask), .esr_value = (_value), .fn = (_handler_fn) }
 
 static const struct sysreg_handler sysreg_handlers[] = {
 	SYSREG_HANDLER(ESR_EL2_SYSREG_ID_MASK, ESR_EL2_SYSREG_ID, handle_id_sysreg_trap),
diff --git a/runtime/include/rsi-logger.h b/runtime/include/rsi-logger.h
index cfa6ca3..c5a506b 100644
--- a/runtime/include/rsi-logger.h
+++ b/runtime/include/rsi-logger.h
@@ -28,8 +28,8 @@
  */
 # define RSI_LOG_SET(regs)	\
 	unsigned long rsi_log_args[] = {			\
-		regs[1], regs[2], regs[3], regs[4], regs[5],	\
-		regs[6], regs[7], regs[8], regs[9], regs[10]	\
+		(regs)[1], (regs)[2], (regs)[3], (regs)[4], (regs)[5],	\
+		(regs)[6], (regs)[7], (regs)[8], (regs)[9], (regs)[10]	\
 	}
 
 /*
diff --git a/runtime/rsi/logger.c b/runtime/rsi/logger.c
index fd88109..031803c 100644
--- a/runtime/rsi/logger.c
+++ b/runtime/rsi/logger.c
@@ -31,9 +31,9 @@
 #define RSI_HANDLER_ID(_id)	SMC64_FID_OFFSET_FROM_RANGE_MIN(RSI, SMC_RSI_##_id)
 
 #define RSI_FUNCTION(_id, _in, _out)[RSI_HANDLER_ID(_id)] = { \
-	.fn_name = #_id,	\
-	.num_args = _in,	\
-	.num_vals = _out	\
+	.fn_name = (#_id),	\
+	.num_args = (_in),	\
+	.num_vals = (_out)	\
 }
 
 static const struct rsi_handler rsi_logger[] = {