qemu: Simplify the image size calculation
authorRadoslaw Biernacki <radoslaw.biernacki@linaro.org>
Thu, 17 May 2018 20:19:35 +0000 (22:19 +0200)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Wed, 18 Sep 2019 13:58:13 +0000 (15:58 +0200)
commit9a006ad10509cf158089470ef713f7edde073eaf
tree3730ccc4409e0b16b1a109db1aad41d3dfe3d39e
parent301d27d998892c054dec925264f81b11dcd64822
qemu: Simplify the image size calculation

Patch introduce the macro NS_IMAGE_MAX_SIZE to simplify the image size
calculation. Use of additional parenthesis removes the possibility of
improper calculations due nested macro expansion for subtraction.
In case of platforms with DRAM window over 32bits, patch also removes
potential problems with type casting, as meminfo.image_size is uint32_t
but macro calculations were done in 64bit space.

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Change-Id: I2d05a2d9dd6000dba6114df53262995cf85af018
plat/qemu/common/qemu_bl2_mem_params_desc.c
plat/qemu/qemu/include/platform_def.h