diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-08-25 10:52:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-25 10:52:44 +0100 |
commit | c1f814660f55c788b0925d6e480eeeca804ed2d4 (patch) | |
tree | ee8c61202eaa787efb5986f88f90775aac79de80 /lib/psci/psci_common.c | |
parent | 5982fa7902403b6a9389a2db040f809ea2b7e695 (diff) | |
parent | 5722b78cdb4a69d08c3c585aae2fb8dd9cbb9bfc (diff) |
Merge pull request #1058 from alistair23/alistair/master
psci_common: Resolve GCC static analysis false positive
Diffstat (limited to 'lib/psci/psci_common.c')
-rw-r--r-- | lib/psci/psci_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index f31b3238..4502c24b 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -194,8 +194,15 @@ static void psci_set_req_local_pwr_state(unsigned int pwrlvl, unsigned int cpu_idx, plat_local_state_t req_pwr_state) { + /* + * This should never happen, we have this here to avoid + * "array subscript is above array bounds" errors in GCC. + */ assert(pwrlvl > PSCI_CPU_PWR_LVL); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state; +#pragma GCC diagnostic pop } /****************************************************************************** |