diff options
author | Zebreus <lennarteichhorn@googlemail.com> | 2023-11-13 21:06:18 +0100 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2023-11-15 08:07:25 +0000 |
commit | 9ba7bada0890671654f534715c134d0259ca55c3 (patch) | |
tree | 29eb4657bfb8f70c7a09c8e6b544c3fe4951e51a /src/arch | |
parent | e00523aae2eab9231b3e21a9b44d828cb86b8297 (diff) |
arch/arm64: Avoid GCC warning about out of bounds array access
With the update to GCC 13 a new warning about subtracting numbers from
arrays appears.
src/arch/arm64/armv8/mmu.c:296:9: error: array subscript -1 is outside array bounds of 'u8[]' {aka 'unsigned char[]'} [-Werror=array-bounds=]
Change-Id: I4757ca2e7ad3f969d7416041ea40c3e9866cdf49
Signed-off-by: Zebreus <lennarteichhorn@googlemail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79014
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm64/armv8/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c index 61ca49ff2c..3cedbcf58f 100644 --- a/src/arch/arm64/armv8/mmu.c +++ b/src/arch/arm64/armv8/mmu.c @@ -293,7 +293,7 @@ void mmu_restore_context(const struct mmu_context *mmu_context) void mmu_enable(void) { assert_correct_ttb_mapping(_ttb); - assert_correct_ttb_mapping(_ettb - 1); + assert_correct_ttb_mapping((void *)((uintptr_t)_ettb - 1)); uint32_t sctlr = raw_read_sctlr_el3(); sctlr |= SCTLR_C | SCTLR_M | SCTLR_I; |