diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-12-26 00:22:47 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-01-24 01:01:21 +0900 |
commit | 6af03f9c455861d1d37439665bc06c415215d36a (patch) | |
tree | add9b0cdfbf13c7858f7acf9244774d007733b86 /plat/arm/common/arm_gicv3.c | |
parent | 3d8256b2a1ef1195aed86bef7378e83d0a61a91b (diff) | |
download | trusted-firmware-a-6af03f9c455861d1d37439665bc06c415215d36a.tar.gz |
Use #ifdef for AARCH32 instead of #if
One nasty part of ATF is some of boolean macros are always defined
as 1 or 0, and the rest of them are only defined under certain
conditions.
For the former group, "#if FOO" or "#if !FOO" must be used because
"#ifdef FOO" is always true. (Options passed by $(call add_define,)
are the cases.)
For the latter, "#ifdef FOO" or "#ifndef FOO" should be used because
checking the value of an undefined macro is strange.
For AARCH32/AARCH64, these macros are defined in the top-level
Makefile as follows:
ifeq (${ARCH},aarch32)
$(eval $(call add_define,AARCH32))
else
$(eval $(call add_define,AARCH64))
endif
This means only one of the two is defined. So, AARCH32/AARCH64
belongs to the latter group where we should use #ifdef or #ifndef.
The conditionals are mostly coded correctly, but I see some mistakes.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'plat/arm/common/arm_gicv3.c')
-rw-r--r-- | plat/arm/common/arm_gicv3.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plat/arm/common/arm_gicv3.c b/plat/arm/common/arm_gicv3.c index acfb3a5208..fd0f1014dc 100644 --- a/plat/arm/common/arm_gicv3.c +++ b/plat/arm/common/arm_gicv3.c @@ -79,7 +79,8 @@ void plat_arm_gic_driver_init(void) * can use GIC system registers to manage interrupts and does * not need GIC interface base addresses to be configured. */ -#if (AARCH32 && defined(IMAGE_BL32)) || (defined(IMAGE_BL31) && !AARCH32) +#if (defined(AARCH32) && defined(IMAGE_BL32)) || \ + (defined(IMAGE_BL31) && !defined(AARCH32)) gicv3_driver_init(&arm_gic_data); #endif } |