summaryrefslogtreecommitdiff
path: root/plat/qemu
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-12-25 23:36:24 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-24 01:01:21 +0900
commit3d8256b2a1ef1195aed86bef7378e83d0a61a91b (patch)
tree1c61d30c342b22f409e5e0d8700448ec39054e52 /plat/qemu
parentf38d93fdbf82ebec321c70f7bc15fe12b7d57275 (diff)
Use #ifdef for IMAGE_BL* 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. Here, IMAGE_BL* is handled by make_helpers/build_macro.mk like follows: $(eval IMAGE := IMAGE_BL$(call uppercase,$(3))) $(OBJ): $(2) @echo " CC $$<" $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -D$(IMAGE) -c $$< -o $$@ This means, IMAGE_BL* is defined when building the corresponding image, but *undefined* for the other images. So, IMAGE_BL* belongs to the latter group where we should use #ifdef or #ifndef. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'plat/qemu')
-rw-r--r--plat/qemu/qemu_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plat/qemu/qemu_common.c b/plat/qemu/qemu_common.c
index 7ba1d34d..0fe7df1a 100644
--- a/plat/qemu/qemu_common.c
+++ b/plat/qemu/qemu_common.c
@@ -68,7 +68,7 @@
* This doesn't include TZRAM as the 'mem_layout' argument passed to
* arm_configure_mmu_elx() will give the available subset of that,
*/
-#if IMAGE_BL1
+#ifdef IMAGE_BL1
static const mmap_region_t plat_qemu_mmap[] = {
MAP_FLASH0,
MAP_SHARED_RAM,
@@ -82,7 +82,7 @@ static const mmap_region_t plat_qemu_mmap[] = {
{0}
};
#endif
-#if IMAGE_BL2
+#ifdef IMAGE_BL2
static const mmap_region_t plat_qemu_mmap[] = {
MAP_FLASH0,
MAP_SHARED_RAM,
@@ -98,7 +98,7 @@ static const mmap_region_t plat_qemu_mmap[] = {
{0}
};
#endif
-#if IMAGE_BL31
+#ifdef IMAGE_BL31
static const mmap_region_t plat_qemu_mmap[] = {
MAP_SHARED_RAM,
MAP_DEVICE0,