From 40692923882928ce52b61bfae1e5507b0076f105 Mon Sep 17 00:00:00 2001 From: Daniel Boulby Date: Thu, 3 May 2018 10:59:09 +0100 Subject: [PATCH] Fix MISRA Rule 5.7 Part 1 Rule 5.7: A tag name shall be a unique identifier There were 2 amu_ctx struct type definitions: - In lib/extensions/amu/aarch64/amu.c - In lib/cpus/aarch64/cpuamu.c Renamed the latter to cpuamu_ctx to avoid this name clash To avoid violation of Rule 8.3 also change name of function amu_ctxs to unique name (cpuamu_ctxs) since it now returns a different type (cpuamu_ctx) than the other amu_ctxs function Fixed for: make LOG_LEVEL=50 PLAT=fvp Change-Id: Ieeb7e390ec2900fd8b775bef312eda93804a43ed Signed-off-by: Daniel Boulby --- lib/cpus/aarch64/cpuamu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cpus/aarch64/cpuamu.c b/lib/cpus/aarch64/cpuamu.c index b9bad8604..5ad5bf839 100644 --- a/lib/cpus/aarch64/cpuamu.c +++ b/lib/cpus/aarch64/cpuamu.c @@ -10,12 +10,12 @@ #define CPUAMU_NR_COUNTERS 5U -struct amu_ctx { +struct cpuamu_ctx { uint64_t cnts[CPUAMU_NR_COUNTERS]; unsigned int mask; }; -static struct amu_ctx amu_ctxs[PLATFORM_CORE_COUNT]; +static struct cpuamu_ctx cpuamu_ctxs[PLATFORM_CORE_COUNT]; int midr_match(unsigned int cpu_midr) { @@ -29,7 +29,7 @@ int midr_match(unsigned int cpu_midr) void cpuamu_context_save(unsigned int nr_counters) { - struct amu_ctx *ctx = &amu_ctxs[plat_my_core_pos()]; + struct cpuamu_ctx *ctx = &cpuamu_ctxs[plat_my_core_pos()]; unsigned int i; assert(nr_counters <= CPUAMU_NR_COUNTERS); @@ -48,7 +48,7 @@ void cpuamu_context_save(unsigned int nr_counters) void cpuamu_context_restore(unsigned int nr_counters) { - struct amu_ctx *ctx = &amu_ctxs[plat_my_core_pos()]; + struct cpuamu_ctx *ctx = &cpuamu_ctxs[plat_my_core_pos()]; unsigned int i; assert(nr_counters <= CPUAMU_NR_COUNTERS);