From 7c934242e3652c4d43f1ce31187d804f627ab8a9 Mon Sep 17 00:00:00 2001 From: Daniel Boulby <daniel.boulby@arm.com> Date: Wed, 9 May 2018 10:28:12 +0100 Subject: [PATCH] Fix MISRA Rule 5.3 Part 3 Use a _ prefix for macro arguments to prevent that argument from hiding variables of the same name in the outer scope Rule 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope Fixed For: make PLAT=fvp SPD=tspd Change-Id: I2d711b9584c4cb9ba3814ecd2ca65a42b7e24179 Signed-off-by: Daniel Boulby <daniel.boulby@arm.com> --- services/spd/tspd/tspd_private.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h index 692a967e3..080e757f4 100644 --- a/services/spd/tspd/tspd_private.h +++ b/services/spd/tspd/tspd_private.h @@ -190,14 +190,14 @@ typedef struct tsp_context { } tsp_context_t; /* Helper macros to store and retrieve tsp args from tsp_context */ -#define store_tsp_args(tsp_ctx, x1, x2) do {\ - tsp_ctx->saved_tsp_args[0] = x1;\ - tsp_ctx->saved_tsp_args[1] = x2;\ +#define store_tsp_args(_tsp_ctx, _x1, _x2) do {\ + _tsp_ctx->saved_tsp_args[0] = _x1;\ + _tsp_ctx->saved_tsp_args[1] = _x2;\ } while (0) -#define get_tsp_args(tsp_ctx, x1, x2) do {\ - x1 = tsp_ctx->saved_tsp_args[0];\ - x2 = tsp_ctx->saved_tsp_args[1];\ +#define get_tsp_args(_tsp_ctx, _x1, _x2) do {\ + _x1 = _tsp_ctx->saved_tsp_args[0];\ + _x2 = _tsp_ctx->saved_tsp_args[1];\ } while (0) /* TSPD power management handlers */ -- GitLab