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 --- bl2/aarch32/bl2_el3_entrypoint.S | 3 +-- bl2/aarch32/bl2_el3_exceptions.S | 2 +- bl2/aarch32/bl2_entrypoint.S | 3 +-- bl2/aarch64/bl2_el3_entrypoint.S | 2 +- bl2/aarch64/bl2_el3_exceptions.S | 4 ++-- bl2/aarch64/bl2_entrypoint.S | 2 +- bl2/bl2.ld.S | 3 ++- bl2/bl2_el3.ld.S | 3 ++- bl2/bl2_image_load_v2.c | 20 +++++++++++--------- bl2/bl2_main.c | 15 ++++++++------- 10 files changed, 30 insertions(+), 27 deletions(-) (limited to 'bl2') diff --git a/bl2/aarch32/bl2_el3_entrypoint.S b/bl2/aarch32/bl2_el3_entrypoint.S index 0c7b0645..cc846ddf 100644 --- a/bl2/aarch32/bl2_el3_entrypoint.S +++ b/bl2/aarch32/bl2_el3_entrypoint.S @@ -6,10 +6,9 @@ #include #include -#include +#include #include - .globl bl2_entrypoint .globl bl2_run_next_image diff --git a/bl2/aarch32/bl2_el3_exceptions.S b/bl2/aarch32/bl2_el3_exceptions.S index 11ddf371..087b6656 100644 --- a/bl2/aarch32/bl2_el3_exceptions.S +++ b/bl2/aarch32/bl2_el3_exceptions.S @@ -6,7 +6,7 @@ #include #include -#include +#include .globl bl2_vector_table diff --git a/bl2/aarch32/bl2_entrypoint.S b/bl2/aarch32/bl2_entrypoint.S index d215f484..e7b98af3 100644 --- a/bl2/aarch32/bl2_entrypoint.S +++ b/bl2/aarch32/bl2_entrypoint.S @@ -6,8 +6,7 @@ #include #include -#include - +#include .globl bl2_vector_table .globl bl2_entrypoint diff --git a/bl2/aarch64/bl2_el3_entrypoint.S b/bl2/aarch64/bl2_el3_entrypoint.S index 2d3efd1f..16b7c0d5 100644 --- a/bl2/aarch64/bl2_el3_entrypoint.S +++ b/bl2/aarch64/bl2_el3_entrypoint.S @@ -6,7 +6,7 @@ #include #include -#include +#include #include .globl bl2_entrypoint diff --git a/bl2/aarch64/bl2_el3_exceptions.S b/bl2/aarch64/bl2_el3_exceptions.S index 07d10406..3d580513 100644 --- a/bl2/aarch64/bl2_el3_exceptions.S +++ b/bl2/aarch64/bl2_el3_exceptions.S @@ -6,8 +6,8 @@ #include #include -#include -#include +#include +#include #include /* ----------------------------------------------------------------------------- diff --git a/bl2/aarch64/bl2_entrypoint.S b/bl2/aarch64/bl2_entrypoint.S index 30a5c599..d938947c 100644 --- a/bl2/aarch64/bl2_entrypoint.S +++ b/bl2/aarch64/bl2_entrypoint.S @@ -6,7 +6,7 @@ #include #include -#include +#include .globl bl2_entrypoint diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S index 6d26cdb2..30cdf7d7 100644 --- a/bl2/bl2.ld.S +++ b/bl2/bl2.ld.S @@ -5,7 +5,8 @@ */ #include -#include + +#include OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S index 82ab427d..af93a0ce 100644 --- a/bl2/bl2_el3.ld.S +++ b/bl2/bl2_el3.ld.S @@ -5,7 +5,8 @@ */ #include -#include + +#include OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c index 0f40785d..dd53e1d2 100644 --- a/bl2/bl2_image_load_v2.c +++ b/bl2/bl2_image_load_v2.c @@ -4,18 +4,20 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include "bl2_private.h" +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "bl2_private.h" /******************************************************************************* * This function loads SCP_BL2/BL3x images and returns the ep_info for diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 101eb33d..019088dc 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -5,13 +5,14 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include + #include "bl2_private.h" #ifdef AARCH32 -- cgit v1.2.3