Commit 40692923 authored by Daniel Boulby's avatar Daniel Boulby
Browse files

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: default avatarDaniel Boulby <daniel.boulby@arm.com>
parent ff4e86f9
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
#define CPUAMU_NR_COUNTERS 5U #define CPUAMU_NR_COUNTERS 5U
struct amu_ctx { struct cpuamu_ctx {
uint64_t cnts[CPUAMU_NR_COUNTERS]; uint64_t cnts[CPUAMU_NR_COUNTERS];
unsigned int mask; 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) int midr_match(unsigned int cpu_midr)
{ {
...@@ -29,7 +29,7 @@ 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) 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; unsigned int i;
assert(nr_counters <= CPUAMU_NR_COUNTERS); assert(nr_counters <= CPUAMU_NR_COUNTERS);
...@@ -48,7 +48,7 @@ void cpuamu_context_save(unsigned int nr_counters) ...@@ -48,7 +48,7 @@ void cpuamu_context_save(unsigned int nr_counters)
void cpuamu_context_restore(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; unsigned int i;
assert(nr_counters <= CPUAMU_NR_COUNTERS); assert(nr_counters <= CPUAMU_NR_COUNTERS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment