Use #ifdef for IMAGE_BL* instead of #if
Masahiro Yamada authored
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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
3d8256b2
Name Last commit Last update
bl1 Fix integer overflows in BL1 FWU code
bl2 Define and use no_ret macro where no return is expected
bl2u Define and use no_ret macro where no return is expected
bl31 Define and use no_ret macro where no return is expected
bl32 Abort preempted TSP STD SMC after PSCI CPU suspend
common Merge pull request #791 from jeenu-arm/asm-assert-32
docs Merge pull request #788 from jeenu-arm/cpuops-framework
drivers Use #ifdef for IMAGE_BL* instead of #if
fdts Fix incorrect copyright notices
include Use #ifdef for IMAGE_BL* instead of #if
lib Use #ifdef for IMAGE_BL* instead of #if
make_helpers Build: add -MP option to add dummy rules to *.d files
plat Use #ifdef for IMAGE_BL* instead of #if
services Abort preempted TSP STD SMC after PSCI CPU suspend
tools fiptool: Factor out setting of image descriptor action
.checkpatch.conf Mandate 'Signed-off-by' line in commit messages
.gitignore .gitignore: ignore editor backup files
Makefile Build: use CPP just for pre-processing
acknowledgements.md Add Xilinx to acknowledgements file
contributing.md Drop requirement for CLA in contribution.md
dco.txt Drop requirement for CLA in contribution.md
license.md Update year in copyright text to 2014
readme.md readme.md: Add tested Linaro release information for FVPs