diff options
author | Alistair Francis <alistair.francis@xilinx.com> | 2017-08-21 11:07:08 -0700 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2017-08-23 00:20:23 +1000 |
commit | a0173167454f0c1429b05a134dd84563a908ebc7 (patch) | |
tree | da5164fa6e508932e1a86544ca66cb6f45d3c003 | |
parent | 6589dfaba21e2f77bae771efcb9253d06de8559d (diff) | |
download | meta-xilinx-a0173167454f0c1429b05a134dd84563a908ebc7.tar.gz |
arm-trusted-firmware: Fix a false positive out of bounds
This error is received while building
services/std_svc/psci/psci_common.c: In function 'psci_do_state_coordination':
services/std_svc/psci/psci_common.c:220:27: error: array subscript is above
array bounds [-Werror=array-bounds]
psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state;
Patch 555ebb34db8f3424c1b394df2f10ecf9c1f70901 explains why the error
is seen and supposibly includes a fix. As the fix appears not to work,
let's disable the error checking.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r-- | recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2017.1.bb | 1 | ||||
-rw-r--r-- | recipes-bsp/arm-trusted-firmware/files/psci_common-Resolve-GCC-static-analysis-false-positi.patch | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2017.1.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2017.1.bb index 52901f25..e68e5cfb 100644 --- a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2017.1.bb +++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2017.1.bb | |||
@@ -6,3 +6,4 @@ SRCREV ?= "7d1a6732c9ae113999aeabcb9912369760d05c13" | |||
6 | PV = "1.3-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" | 6 | PV = "1.3-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" |
7 | 7 | ||
8 | SRC_URI += "file://zynqmp-Remove-duplicate-const-declaration.patch" | 8 | SRC_URI += "file://zynqmp-Remove-duplicate-const-declaration.patch" |
9 | SRC_URI += "file://psci_common-Resolve-GCC-static-analysis-false-positi.patch" | ||
diff --git a/recipes-bsp/arm-trusted-firmware/files/psci_common-Resolve-GCC-static-analysis-false-positi.patch b/recipes-bsp/arm-trusted-firmware/files/psci_common-Resolve-GCC-static-analysis-false-positi.patch new file mode 100644 index 00000000..f7065859 --- /dev/null +++ b/recipes-bsp/arm-trusted-firmware/files/psci_common-Resolve-GCC-static-analysis-false-positi.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 0197ad57b44fb7f10ca604891e0974110748fbd5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@xilinx.com> | ||
3 | Date: Mon, 21 Aug 2017 10:19:40 -0700 | ||
4 | Subject: [PATCH] psci_common: Resolve GCC static analysis false positive | ||
5 | |||
6 | Previously commit 555ebb34db8f3424c1b394df2f10ec attmpted to fix this | ||
7 | GCC issue: | ||
8 | |||
9 | services/std_svc/psci/psci_common.c: In function 'psci_do_state_coordination': | ||
10 | services/std_svc/psci/psci_common.c:220:27: error: array subscript is above | ||
11 | array bounds [-Werror=array-bounds] | ||
12 | psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state; | ||
13 | |||
14 | This fix doesn't work as asserts aren't built in non-debug build flows. | ||
15 | Let's ensure this error is fixed for all build cases. | ||
16 | |||
17 | Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> | ||
18 | Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> | ||
19 | --- | ||
20 | Upstream Status: Pending | ||
21 | |||
22 | lib/psci/psci_common.c | 2 ++ | ||
23 | 1 file changed, 2 insertions(+) | ||
24 | |||
25 | diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c | ||
26 | index 68cdd6eb..a8c94215 100644 | ||
27 | --- a/lib/psci/psci_common.c | ||
28 | +++ b/lib/psci/psci_common.c | ||
29 | @@ -394,6 +394,8 @@ void psci_do_state_coordination(unsigned int end_pwrlvl, | ||
30 | plat_local_state_t target_state, *req_states; | ||
31 | |||
32 | assert(end_pwrlvl <= PLAT_MAX_PWR_LVL); | ||
33 | + if (end_pwrlvl > PLAT_MAX_PWR_LVL) | ||
34 | + return; | ||
35 | parent_idx = psci_cpu_pd_nodes[cpu_idx].parent_node; | ||
36 | |||
37 | /* For level 0, the requested state will be equivalent | ||
38 | -- | ||
39 | 2.11.0 | ||
40 | |||