diff options
author | Justin Chadwell <justin.chadwell@arm.com> | 2019-09-17 15:21:50 +0100 |
---|---|---|
committer | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2019-11-19 08:53:16 -0600 |
commit | b7f6525db642d533327403ff8130eb91190f2e98 (patch) | |
tree | fcca63549f0f8c7ab15e706c6995de38aa2290d0 /services | |
parent | b8baa9346aaad24f8da48e408e0dbd5e65619905 (diff) | |
download | platform_external_arm-trusted-firmware-b7f6525db642d533327403ff8130eb91190f2e98.tar.gz platform_external_arm-trusted-firmware-b7f6525db642d533327403ff8130eb91190f2e98.tar.bz2 platform_external_arm-trusted-firmware-b7f6525db642d533327403ff8130eb91190f2e98.zip |
Enable -Wshadow always
Variable shadowing is, according to the C standard, permitted and valid
behaviour. However, allowing a local variable to take the same name as a
global one can cause confusion and can make refactoring and bug hunting
more difficult.
This patch moves -Wshadow from WARNING2 into the general warning group
so it is always used. It also fixes all warnings that this introduces
by simply renaming the local variable to a new name
Change-Id: I6b71bdce6580c6e58b5e0b41e4704ab0aa38576e
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/std_svc/spm_mm/spm_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/std_svc/spm_mm/spm_main.c b/services/std_svc/spm_mm/spm_main.c index 7525763b1..706b69d9f 100644 --- a/services/std_svc/spm_mm/spm_main.c +++ b/services/std_svc/spm_mm/spm_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -86,14 +86,14 @@ int sp_state_try_switch(sp_context_t *sp_ptr, sp_state_t from, sp_state_t to) * This function takes an SP context pointer and performs a synchronous entry * into it. ******************************************************************************/ -static uint64_t spm_sp_synchronous_entry(sp_context_t *sp_ctx) +static uint64_t spm_sp_synchronous_entry(sp_context_t *ctx) { uint64_t rc; - assert(sp_ctx != NULL); + assert(ctx != NULL); /* Assign the context of the SP to this CPU */ - cm_set_context(&(sp_ctx->cpu_ctx), SECURE); + cm_set_context(&(ctx->cpu_ctx), SECURE); /* Restore the context assigned above */ cm_el1_sysregs_context_restore(SECURE); @@ -104,7 +104,7 @@ static uint64_t spm_sp_synchronous_entry(sp_context_t *sp_ctx) dsbish(); /* Enter Secure Partition */ - rc = spm_secure_partition_enter(&sp_ctx->c_rt_ctx); + rc = spm_secure_partition_enter(&ctx->c_rt_ctx); /* Save secure state */ cm_el1_sysregs_context_save(SECURE); |