From 09d40e0e08283a249e7dce0e106c07c5141f9b7e Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Fri, 14 Dec 2018 00:18:21 +0000 Subject: Sanitise includes across codebase Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support"). This problem was introduced in commit 4ecca33988b9 ("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz --- plat/imx/imx7/warp7/include/platform_def.h | 4 ++-- plat/imx/imx7/warp7/warp7_bl2_el3_setup.c | 26 ++++++++++++++----------- plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c | 7 ++++--- plat/imx/imx7/warp7/warp7_image_load.c | 6 +++--- plat/imx/imx7/warp7/warp7_io_storage.c | 17 +++++++++------- 5 files changed, 34 insertions(+), 26 deletions(-) (limited to 'plat/imx/imx7') diff --git a/plat/imx/imx7/warp7/include/platform_def.h b/plat/imx/imx7/warp7/include/platform_def.h index 4ee6fd37d..a931c8062 100644 --- a/plat/imx/imx7/warp7/include/platform_def.h +++ b/plat/imx/imx7/warp7/include/platform_def.h @@ -8,8 +8,8 @@ #define PLATFORM_DEF_H #include -#include -#include +#include +#include #define PLATFORM_STACK_SIZE 0x1000 diff --git a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c index 10c4160cf..032ed7b19 100644 --- a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c +++ b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c @@ -4,19 +4,22 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include #include -#include -#include -#include -#include -#include -#include -#include + #include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -27,6 +30,7 @@ #include #include #include + #include "warp7_private.h" #define UART1_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\ diff --git a/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c b/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c index 12254d46c..a29e14198 100644 --- a/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c +++ b/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c @@ -4,11 +4,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include -#include -#include #include +#include +#include +#include + static bl_mem_params_node_t bl2_mem_params_descs[] = { { .image_id = BL32_IMAGE_ID, diff --git a/plat/imx/imx7/warp7/warp7_image_load.c b/plat/imx/imx7/warp7/warp7_image_load.c index 1e3a2b0b5..c3e47b9d7 100644 --- a/plat/imx/imx7/warp7/warp7_image_load.c +++ b/plat/imx/imx7/warp7/warp7_image_load.c @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include -#include -#include +#include +#include +#include void plat_flush_next_bl_params(void) { diff --git a/plat/imx/imx7/warp7/warp7_io_storage.c b/plat/imx/imx7/warp7/warp7_io_storage.c index 8354766ae..b9cace090 100644 --- a/plat/imx/imx7/warp7/warp7_io_storage.c +++ b/plat/imx/imx7/warp7/warp7_io_storage.c @@ -3,16 +3,19 @@ * * SPDX-License-Identifier: BSD-3-Clause */ + #include -#include -#include -#include -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include +#include +#include + static const io_dev_connector_t *fip_dev_con; static uintptr_t fip_dev_handle; -- cgit v1.2.3