Standardise header guards across codebase

All identifiers, regardless of use, that start with two underscores are
reserved. This means they can't be used in header guards.

The style that this project is now to use the full name of the file in
capital letters followed by 'H'. For example, for a file called
"uart_example.h", the header guard is UART_EXAMPLE_H.

The exceptions are files that are imported from other projects:

- CryptoCell driver
- dt-bindings folders
- zlib headers

Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/include/lib/aarch32/arch.h b/include/lib/aarch32/arch.h
index 3536d20..38e01bd 100644
--- a/include/lib/aarch32/arch.h
+++ b/include/lib/aarch32/arch.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __ARCH_H__
-#define __ARCH_H__
+#ifndef ARCH_H
+#define ARCH_H
 
 #include <utils_def.h>
 
@@ -630,4 +630,4 @@
 #define AMEVTYPER1E	p15, 0, c13, c15, 6
 #define AMEVTYPER1F	p15, 0, c13, c15, 7
 
-#endif /* __ARCH_H__ */
+#endif /* ARCH_H */
diff --git a/include/lib/aarch32/smccc_helpers.h b/include/lib/aarch32/smccc_helpers.h
index 5eeb204..67952ec 100644
--- a/include/lib/aarch32/smccc_helpers.h
+++ b/include/lib/aarch32/smccc_helpers.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __SMCCC_HELPERS_H__
-#define __SMCCC_HELPERS_H__
+#ifndef SMCCC_HELPERS_H
+#define SMCCC_HELPERS_H
 
 #include <smccc.h>
 
@@ -156,4 +156,4 @@
 
 #endif /*__ASSEMBLY__*/
 
-#endif /* __SMCCC_HELPERS_H__ */
+#endif /* SMCCC_HELPERS_H */
diff --git a/include/lib/aarch32/smccc_macros.S b/include/lib/aarch32/smccc_macros.S
index fdb65e8..1fe6c64 100644
--- a/include/lib/aarch32/smccc_macros.S
+++ b/include/lib/aarch32/smccc_macros.S
@@ -3,8 +3,8 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#ifndef __SMCCC_MACROS_S__
-#define __SMCCC_MACROS_S__
+#ifndef SMCCC_MACROS_S
+#define SMCCC_MACROS_S
 
 #include <arch.h>
 
@@ -196,4 +196,4 @@
 	eret
 	.endm
 
-#endif /* __SMCCC_MACROS_S__ */
+#endif /* SMCCC_MACROS_S */
diff --git a/include/lib/aarch64/setjmp.h b/include/lib/aarch64/setjmp.h
index c65810d..bbfe1df 100644
--- a/include/lib/aarch64/setjmp.h
+++ b/include/lib/aarch64/setjmp.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __JMP_H__
-#define __JMP_H__
+#ifndef SETJMP_H
+#define SETJMP_H
 
 #define JMP_CTX_X19	0x0
 #define JMP_CTX_X21	0x10
@@ -56,4 +56,4 @@
 void longjmp(struct jmpbuf *buf);
 
 #endif /* __ASSEMBLY__ */
-#endif /* __JMP_H__ */
+#endif /* SETJMP_H */
diff --git a/include/lib/aarch64/smccc_helpers.h b/include/lib/aarch64/smccc_helpers.h
index c76faf5..efab18b 100644
--- a/include/lib/aarch64/smccc_helpers.h
+++ b/include/lib/aarch64/smccc_helpers.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __SMCCC_HELPERS_H__
-#define __SMCCC_HELPERS_H__
+#ifndef SMCCC_HELPERS_H
+#define SMCCC_HELPERS_H
 
 #include <smccc.h>
 
@@ -82,4 +82,4 @@
 
 #endif /*__ASSEMBLY__*/
 
-#endif /* __SMCCC_HELPERS_H__ */
+#endif /* SMCCC_HELPERS_H */
diff --git a/include/lib/cassert.h b/include/lib/cassert.h
index 3119e1f..bbfdfdb 100644
--- a/include/lib/cassert.h
+++ b/include/lib/cassert.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CASSERT_H__
-#define __CASSERT_H__
+#ifndef CASSERT_H
+#define CASSERT_H
 
 #include <cdefs.h>
 
@@ -20,4 +20,4 @@
 #define CASSERT(cond, msg)	\
 	typedef char msg[(cond) ? 1 : -1] __unused
 
-#endif /* __CASSERT_H__ */
+#endif /* CASSERT_H */
diff --git a/include/lib/coreboot.h b/include/lib/coreboot.h
index f8fbd93..88212c3 100644
--- a/include/lib/coreboot.h
+++ b/include/lib/coreboot.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __COREBOOT_H__
-#define __COREBOOT_H__
+#ifndef COREBOOT_H
+#define COREBOOT_H
 
 #include <stdint.h>
 
@@ -21,4 +21,4 @@
 
 void coreboot_table_setup(void *base);
 
-#endif /* __COREBOOT_H__ */
+#endif /* COREBOOT_H */
diff --git a/include/lib/cpus/aarch32/aem_generic.h b/include/lib/cpus/aarch32/aem_generic.h
index f5476df..5fbdf53 100644
--- a/include/lib/cpus/aarch32/aem_generic.h
+++ b/include/lib/cpus/aarch32/aem_generic.h
@@ -4,10 +4,10 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __AEM_GENERIC_H__
-#define __AEM_GENERIC_H__
+#ifndef AEM_GENERIC_H
+#define AEM_GENERIC_H
 
 /* BASE AEM midr for revision 0 */
 #define BASE_AEM_MIDR 0x410FD0F0
 
-#endif /* __AEM_GENERIC_H__ */
+#endif /* AEM_GENERIC_H */
diff --git a/include/lib/cpus/aarch32/cortex_a12.h b/include/lib/cpus/aarch32/cortex_a12.h
index 3068a41..3aa7278 100644
--- a/include/lib/cpus/aarch32/cortex_a12.h
+++ b/include/lib/cpus/aarch32/cortex_a12.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A12_H__
-#define __CORTEX_A12_H__
+#ifndef CORTEX_A12_H
+#define CORTEX_A12_H
 
 /*******************************************************************************
  * Cortex-A12 midr with version/revision set to 0
@@ -17,4 +17,4 @@
  ******************************************************************************/
 #define CORTEX_A12_ACTLR_SMP_BIT	(1 << 6)
 
-#endif /* __CORTEX_A12_H__ */
+#endif /* CORTEX_A12_H */
diff --git a/include/lib/cpus/aarch32/cortex_a15.h b/include/lib/cpus/aarch32/cortex_a15.h
index 0f01a43..ca842f6 100644
--- a/include/lib/cpus/aarch32/cortex_a15.h
+++ b/include/lib/cpus/aarch32/cortex_a15.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A15_H__
-#define __CORTEX_A15_H__
+#ifndef CORTEX_A15_H
+#define CORTEX_A15_H
 
 /*******************************************************************************
  * Cortex-A15 midr with version/revision set to 0
@@ -18,4 +18,4 @@
 #define CORTEX_A15_ACTLR_INV_BTB_BIT	(1 << 0)
 #define CORTEX_A15_ACTLR_SMP_BIT	(1 << 6)
 
-#endif /* __CORTEX_A15_H__ */
+#endif /* CORTEX_A15_H */
diff --git a/include/lib/cpus/aarch32/cortex_a17.h b/include/lib/cpus/aarch32/cortex_a17.h
index d2ca91c..b5a4a90 100644
--- a/include/lib/cpus/aarch32/cortex_a17.h
+++ b/include/lib/cpus/aarch32/cortex_a17.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A17_H__
-#define __CORTEX_A17_H__
+#ifndef CORTEX_A17_H
+#define CORTEX_A17_H
 
 /*******************************************************************************
  * Cortex-A17 midr with version/revision set to 0
@@ -17,4 +17,4 @@
  ******************************************************************************/
 #define CORTEX_A17_ACTLR_SMP_BIT	(1 << 6)
 
-#endif /* __CORTEX_A17_H__ */
+#endif /* CORTEX_A17_H */
diff --git a/include/lib/cpus/aarch32/cortex_a32.h b/include/lib/cpus/aarch32/cortex_a32.h
index 4d6826a..36322d2 100644
--- a/include/lib/cpus/aarch32/cortex_a32.h
+++ b/include/lib/cpus/aarch32/cortex_a32.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A32_H__
-#define __CORTEX_A32_H__
+#ifndef CORTEX_A32_H
+#define CORTEX_A32_H
 
 /* Cortex-A32 Main ID register for revision 0 */
 #define CORTEX_A32_MIDR				0x410FD010
@@ -17,4 +17,4 @@
 #define CORTEX_A32_CPUECTLR_EL1			p15, 1, c15
 #define CORTEX_A32_CPUECTLR_SMPEN_BIT		(1 << 6)
 
-#endif /* __CORTEX_A32_H__ */
+#endif /* CORTEX_A32_H */
diff --git a/include/lib/cpus/aarch32/cortex_a5.h b/include/lib/cpus/aarch32/cortex_a5.h
index 0a0b7ff..3e58f25 100644
--- a/include/lib/cpus/aarch32/cortex_a5.h
+++ b/include/lib/cpus/aarch32/cortex_a5.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A5_H__
-#define __CORTEX_A5_H__
+#ifndef CORTEX_A5_H
+#define CORTEX_A5_H
 
 /*******************************************************************************
  * Cortex-A8 midr with version/revision set to 0
@@ -17,4 +17,4 @@
  ******************************************************************************/
 #define CORTEX_A5_ACTLR_SMP_BIT		(1 << 6)
 
-#endif /* __CORTEX_A5_H__ */
+#endif /* CORTEX_A5_H */
diff --git a/include/lib/cpus/aarch32/cortex_a53.h b/include/lib/cpus/aarch32/cortex_a53.h
index a7a681f..a2d7ec0 100644
--- a/include/lib/cpus/aarch32/cortex_a53.h
+++ b/include/lib/cpus/aarch32/cortex_a53.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A53_H__
-#define __CORTEX_A53_H__
+#ifndef CORTEX_A53_H
+#define CORTEX_A53_H
 
 /* Cortex-A53 midr for revision 0 */
 #define CORTEX_A53_MIDR 0x410FD030
@@ -67,4 +67,4 @@
  ******************************************************************************/
 #define CORTEX_A53_L2MERRSR			p15, 3, c15
 
-#endif /* __CORTEX_A53_H__ */
+#endif /* CORTEX_A53_H */
diff --git a/include/lib/cpus/aarch32/cortex_a57.h b/include/lib/cpus/aarch32/cortex_a57.h
index 3f0fb04..6f60c11 100644
--- a/include/lib/cpus/aarch32/cortex_a57.h
+++ b/include/lib/cpus/aarch32/cortex_a57.h
@@ -4,8 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A57_H__
-#define __CORTEX_A57_H__
+#ifndef CORTEX_A57_H
+#define CORTEX_A57_H
+
 #include <utils_def.h>
 
 /* Cortex-A57 midr for revision 0 */
@@ -79,4 +80,4 @@
  ******************************************************************************/
 #define CORTEX_A57_L2MERRSR			p15, 3, c15
 
-#endif /* __CORTEX_A57_H__ */
+#endif /* CORTEX_A57_H */
diff --git a/include/lib/cpus/aarch32/cortex_a7.h b/include/lib/cpus/aarch32/cortex_a7.h
index 61b0d00..03fc118 100644
--- a/include/lib/cpus/aarch32/cortex_a7.h
+++ b/include/lib/cpus/aarch32/cortex_a7.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A7_H__
-#define __CORTEX_A7_H__
+#ifndef CORTEX_A7_H
+#define CORTEX_A7_H
 
 /*******************************************************************************
  * Cortex-A7 midr with version/revision set to 0
@@ -17,4 +17,4 @@
  ******************************************************************************/
 #define CORTEX_A7_ACTLR_SMP_BIT		(1 << 6)
 
-#endif /* __CORTEX_A7_H__ */
+#endif /* CORTEX_A7_H */
diff --git a/include/lib/cpus/aarch32/cortex_a72.h b/include/lib/cpus/aarch32/cortex_a72.h
index 1a3c014..f45865a 100644
--- a/include/lib/cpus/aarch32/cortex_a72.h
+++ b/include/lib/cpus/aarch32/cortex_a72.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A72_H__
-#define __CORTEX_A72_H__
+#ifndef CORTEX_A72_H
+#define CORTEX_A72_H
 #include <utils_def.h>
 
 /* Cortex-A72 midr for revision 0 */
@@ -54,4 +54,4 @@
  ******************************************************************************/
 #define CORTEX_A72_L2MERRSR				p15, 3, c15
 
-#endif /* __CORTEX_A72_H__ */
+#endif /* CORTEX_A72_H */
diff --git a/include/lib/cpus/aarch32/cortex_a9.h b/include/lib/cpus/aarch32/cortex_a9.h
index be85f9b..a9e86ef 100644
--- a/include/lib/cpus/aarch32/cortex_a9.h
+++ b/include/lib/cpus/aarch32/cortex_a9.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A9_H__
-#define __CORTEX_A9_H__
+#ifndef CORTEX_A9_H
+#define CORTEX_A9_H
 
 /*******************************************************************************
  * Cortex-A9 midr with version/revision set to 0
@@ -28,4 +28,4 @@
 DEFINE_COPROCR_RW_FUNCS(pcr, PCR)
 #endif
 
-#endif /* __CORTEX_A9_H__ */
+#endif /* CORTEX_A9_H */
diff --git a/include/lib/cpus/aarch32/cpu_macros.S b/include/lib/cpus/aarch32/cpu_macros.S
index aa728b2..1c0da0f 100644
--- a/include/lib/cpus/aarch32/cpu_macros.S
+++ b/include/lib/cpus/aarch32/cpu_macros.S
@@ -3,8 +3,8 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#ifndef __CPU_MACROS_S__
-#define __CPU_MACROS_S__
+#ifndef CPU_MACROS_S
+#define CPU_MACROS_S
 
 #include <arch.h>
 #include <errata_report.h>
@@ -227,4 +227,4 @@
 	beq	\_label
 	.endm
 
-#endif /* __CPU_MACROS_S__ */
+#endif /* CPU_MACROS_S */
diff --git a/include/lib/cpus/aarch64/aem_generic.h b/include/lib/cpus/aarch64/aem_generic.h
index ddb235f..1edef84 100644
--- a/include/lib/cpus/aarch64/aem_generic.h
+++ b/include/lib/cpus/aarch64/aem_generic.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __AEM_GENERIC_H__
-#define __AEM_GENERIC_H__
+#ifndef AEM_GENERIC_H
+#define AEM_GENERIC_H
 
 /* BASE AEM midr for revision 0 */
 #define BASE_AEM_MIDR 0x410FD0F0
@@ -13,5 +13,4 @@
 /* Foundation AEM midr for revision 0 */
 #define FOUNDATION_AEM_MIDR  0x410FD000
 
-
-#endif /* __AEM_GENERIC_H__ */
+#endif /* AEM_GENERIC_H */
diff --git a/include/lib/cpus/aarch64/cortex_a35.h b/include/lib/cpus/aarch64/cortex_a35.h
index ad0fedc..2363198 100644
--- a/include/lib/cpus/aarch64/cortex_a35.h
+++ b/include/lib/cpus/aarch64/cortex_a35.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A35_H__
-#define __CORTEX_A35_H__
+#ifndef CORTEX_A35_H
+#define CORTEX_A35_H
 
 /* Cortex-A35 Main ID register for revision 0 */
 #define CORTEX_A35_MIDR				0x410FD040
@@ -17,4 +17,4 @@
 #define CORTEX_A35_CPUECTLR_EL1			S3_1_C15_C2_1
 #define CORTEX_A35_CPUECTLR_SMPEN_BIT		(1 << 6)
 
-#endif /* __CORTEX_A35_H__ */
+#endif /* CORTEX_A35_H */
diff --git a/include/lib/cpus/aarch64/cortex_a53.h b/include/lib/cpus/aarch64/cortex_a53.h
index 9aa118b..4b7d238 100644
--- a/include/lib/cpus/aarch64/cortex_a53.h
+++ b/include/lib/cpus/aarch64/cortex_a53.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A53_H__
-#define __CORTEX_A53_H__
+#ifndef CORTEX_A53_H
+#define CORTEX_A53_H
 
 /* Cortex-A53 midr for revision 0 */
 #define CORTEX_A53_MIDR			U(0x410FD030)
@@ -71,4 +71,4 @@
  ******************************************************************************/
 #define CORTEX_A53_L2MERRSR_EL1				S3_1_C15_C2_3
 
-#endif /* __CORTEX_A53_H__ */
+#endif /* CORTEX_A53_H */
diff --git a/include/lib/cpus/aarch64/cortex_a55.h b/include/lib/cpus/aarch64/cortex_a55.h
index 293f2b2..763b7cb 100644
--- a/include/lib/cpus/aarch64/cortex_a55.h
+++ b/include/lib/cpus/aarch64/cortex_a55.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A55_H__
-#define __CORTEX_A55_H__
+#ifndef CORTEX_A55_H
+#define CORTEX_A55_H
 
 /* Cortex-A55 MIDR for revision 0 */
 #define CORTEX_A55_MIDR		0x410fd050
@@ -19,4 +19,4 @@
 /* Definitions of register field mask in CORTEX_A55_CPUPWRCTLR_EL1 */
 #define CORTEX_A55_CORE_PWRDN_EN_MASK	0x1
 
-#endif /* __CORTEX_A55_H__ */
+#endif /* CORTEX_A55_H */
diff --git a/include/lib/cpus/aarch64/cortex_a57.h b/include/lib/cpus/aarch64/cortex_a57.h
index 97d074e..71d07db 100644
--- a/include/lib/cpus/aarch64/cortex_a57.h
+++ b/include/lib/cpus/aarch64/cortex_a57.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A57_H__
-#define __CORTEX_A57_H__
+#ifndef CORTEX_A57_H
+#define CORTEX_A57_H
 #include <utils_def.h>
 
 /* Cortex-A57 midr for revision 0 */
@@ -81,4 +81,4 @@
  ******************************************************************************/
 #define CORTEX_A57_L2MERRSR_EL1			S3_1_C15_C2_3
 
-#endif /* __CORTEX_A57_H__ */
+#endif /* CORTEX_A57_H */
diff --git a/include/lib/cpus/aarch64/cortex_a72.h b/include/lib/cpus/aarch64/cortex_a72.h
index 5b9e06d..4eafc11 100644
--- a/include/lib/cpus/aarch64/cortex_a72.h
+++ b/include/lib/cpus/aarch64/cortex_a72.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A72_H__
-#define __CORTEX_A72_H__
+#ifndef CORTEX_A72_H
+#define CORTEX_A72_H
 #include <utils_def.h>
 
 /* Cortex-A72 midr for revision 0 */
@@ -61,4 +61,4 @@
  ******************************************************************************/
 #define CORTEX_A72_L2MERRSR_EL1				S3_1_C15_C2_3
 
-#endif /* __CORTEX_A72_H__ */
+#endif /* CORTEX_A72_H */
diff --git a/include/lib/cpus/aarch64/cortex_a73.h b/include/lib/cpus/aarch64/cortex_a73.h
index 4db0cae..77ea205 100644
--- a/include/lib/cpus/aarch64/cortex_a73.h
+++ b/include/lib/cpus/aarch64/cortex_a73.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A73_H__
-#define __CORTEX_A73_H__
+#ifndef CORTEX_A73_H
+#define CORTEX_A73_H
 
 /* Cortex-A73 midr for revision 0 */
 #define CORTEX_A73_MIDR	0x410FD090
@@ -29,4 +29,4 @@
 
 #define CORTEX_A73_IMP_DEF_REG1_DISABLE_LOAD_PASS_STORE	(1 << 3)
 
-#endif /* __CORTEX_A73_H__ */
+#endif /* CORTEX_A73_H */
diff --git a/include/lib/cpus/aarch64/cortex_a76.h b/include/lib/cpus/aarch64/cortex_a76.h
index 1cb7747..4dea64b 100644
--- a/include/lib/cpus/aarch64/cortex_a76.h
+++ b/include/lib/cpus/aarch64/cortex_a76.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_A76_H__
-#define __CORTEX_A76_H__
+#ifndef CORTEX_A76_H
+#define CORTEX_A76_H
 
 /* Cortex-A76 MIDR for revision 0 */
 #define CORTEX_A76_MIDR		0x410fd0b0
@@ -26,4 +26,4 @@
 /* Definitions of register field mask in CORTEX_A76_CPUPWRCTLR_EL1 */
 #define CORTEX_A76_CORE_PWRDN_EN_MASK	0x1
 
-#endif /* __CORTEX_A76_H__ */
+#endif /* CORTEX_A76_H */
diff --git a/include/lib/cpus/aarch64/cortex_deimos.h b/include/lib/cpus/aarch64/cortex_deimos.h
index 3c36567..694fb15 100644
--- a/include/lib/cpus/aarch64/cortex_deimos.h
+++ b/include/lib/cpus/aarch64/cortex_deimos.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_DEIMOS_H__
-#define __CORTEX_DEIMOS_H__
+#ifndef CORTEX_DEIMOS_H
+#define CORTEX_DEIMOS_H
 
 #define CORTEX_DEIMOS_MIDR					U(0x410FD0D0)
 
@@ -20,4 +20,4 @@
 #define CORTEX_DEIMOS_CPUPWRCTLR_EL1				S3_0_C15_C2_7
 #define CORTEX_DEIMOS_CPUPWRCTLR_EL1_CORE_PWRDN_BIT		(U(1) << 0)
 
-#endif /* __CORTEX_DEIMOS_H__ */
+#endif /* CORTEX_DEIMOS_H */
diff --git a/include/lib/cpus/aarch64/cortex_helios.h b/include/lib/cpus/aarch64/cortex_helios.h
index 1098a12..571ea9d 100644
--- a/include/lib/cpus/aarch64/cortex_helios.h
+++ b/include/lib/cpus/aarch64/cortex_helios.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __CORTEX_HELIOS_H__
-#define __CORTEX_HELIOS_H__
+#ifndef CORTEX_HELIOS_H
+#define CORTEX_HELIOS_H
 
 #define CORTEX_HELIOS_MIDR		U(0x410FD060)
 
@@ -26,4 +26,4 @@
 #define CORTEX_HELIOS_CPUPWRCTLR_EL1				S3_0_C15_C2_7
 #define CORTEX_HELIOS_CPUPWRCTLR_EL1_CORE_PWRDN_BIT		(U(1) << 0)
 
-#endif /* __CORTEX_HELIOS_H__ */
+#endif /* CORTEX_HELIOS_H */
diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S
index 14616ac..2875700 100644
--- a/include/lib/cpus/aarch64/cpu_macros.S
+++ b/include/lib/cpus/aarch64/cpu_macros.S
@@ -3,8 +3,8 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#ifndef __CPU_MACROS_S__
-#define __CPU_MACROS_S__
+#ifndef CPU_MACROS_S
+#define CPU_MACROS_S
 
 #include <arch.h>
 #include <errata_report.h>
@@ -255,8 +255,6 @@
 	.endm
 #endif
 
-#endif /* __CPU_MACROS_S__ */
-
 	/*
 	 * This macro is used on some CPUs to detect if they are vulnerable
 	 * to CVE-2017-5715.
@@ -285,3 +283,5 @@
 	cmp	w0, #((\_cpu_midr >> MIDR_PN_SHIFT) & MIDR_PN_MASK)
 	b.eq	\_label
 	.endm
+
+#endif /* CPU_MACROS_S */
diff --git a/include/lib/cpus/aarch64/denver.h b/include/lib/cpus/aarch64/denver.h
index 712a4a4..81c076a 100644
--- a/include/lib/cpus/aarch64/denver.h
+++ b/include/lib/cpus/aarch64/denver.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __DENVER_H__
-#define __DENVER_H__
+#ifndef DENVER_H
+#define DENVER_H
 
 /* MIDR values for Denver */
 #define DENVER_MIDR_PN0			U(0x4E0F0000)
@@ -39,6 +39,6 @@
 /* Disable Dynamic Code Optimisation */
 void denver_disable_dco(void);
 
-#endif
+#endif /* __ASSEMBLY__ */
 
-#endif /* __DENVER_H__ */
+#endif /* DENVER_H */
diff --git a/include/lib/el3_runtime/pubsub.h b/include/lib/el3_runtime/pubsub.h
index 2c8a196..930952f 100644
--- a/include/lib/el3_runtime/pubsub.h
+++ b/include/lib/el3_runtime/pubsub.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __PUBSUB_H__
-#define __PUBSUB_H__
+#ifndef PUBSUB_H
+#define PUBSUB_H
 
 #define __pubsub_start_sym(event)	__pubsub_##event##_start
 #define __pubsub_end_sym(event)		__pubsub_##event##_end
@@ -84,4 +84,4 @@
 typedef void* (*pubsub_cb_t)(const void *arg);
 
 #endif	/* __LINKER__ */
-#endif	/* __PUBSUB_H__ */
+#endif /* PUBSUB_H */
diff --git a/include/lib/extensions/ras.h b/include/lib/extensions/ras.h
index 400de59..62fd63f 100644
--- a/include/lib/extensions/ras.h
+++ b/include/lib/extensions/ras.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef RAS_COMMON
-#define RAS_COMMON
+#ifndef RAS_H
+#define RAS_H
 
 #define ERR_HANDLER_VERSION	1U
 
@@ -196,4 +196,5 @@
 void ras_init(void);
 
 #endif /* __ASSEMBLY__ */
-#endif /* RAS_COMMON */
+
+#endif /* RAS_H */
diff --git a/include/lib/libc/aarch32/endian_.h b/include/lib/libc/aarch32/endian_.h
index 83a26b7..0cf2c75 100644
--- a/include/lib/libc/aarch32/endian_.h
+++ b/include/lib/libc/aarch32/endian_.h
@@ -36,8 +36,8 @@
  * All rights reserved.
  */
 
-#ifndef AARCH32_ENDIAN_H
-#define AARCH32_ENDIAN_H
+#ifndef ENDIAN__H
+#define ENDIAN__H
 
 #include <stdint.h>
 
@@ -143,4 +143,4 @@
 #define __bswap32(x)	__bswap32_var(x)
 
 #endif /* __OPTIMIZE__ */
-#endif /* AARCH32_ENDIAN_H */
+#endif /* ENDIAN__H */
diff --git a/include/lib/libc/aarch32/stddef_.h b/include/lib/libc/aarch32/stddef_.h
index 928481c..1babfad 100644
--- a/include/lib/libc/aarch32/stddef_.h
+++ b/include/lib/libc/aarch32/stddef_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDDEF__H
+#define STDDEF__H
+
 #ifndef SIZET_
 typedef unsigned int size_t;
 #define SIZET_
@@ -13,3 +16,5 @@
 typedef long ptrdiff_t;
 #define _PTRDIFF_T
 #endif
+
+#endif /* STDDEF__H */
diff --git a/include/lib/libc/aarch32/stdio_.h b/include/lib/libc/aarch32/stdio_.h
index 98304bc..50d3cc2 100644
--- a/include/lib/libc/aarch32/stdio_.h
+++ b/include/lib/libc/aarch32/stdio_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDIO__H
+#define STDIO__H
+
 #ifndef SIZET_
 typedef unsigned int size_t;
 #define SIZET_
@@ -13,3 +16,5 @@
 typedef int ssize_t;
 #define SSIZET_
 #endif
+
+#endif /* STDIO__H */
diff --git a/include/lib/libc/aarch32/stdlib_.h b/include/lib/libc/aarch32/stdlib_.h
index af96d01..9c07857 100644
--- a/include/lib/libc/aarch32/stdlib_.h
+++ b/include/lib/libc/aarch32/stdlib_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDLIB__H
+#define STDLIB__H
+
 #ifndef SIZET_
 typedef unsigned int size_t;
 #define SIZET_
@@ -11,3 +14,5 @@
 
 #define EXIT_FAILURE 1
 #define EXIT_SUCCESS 0
+
+#endif /* STDLIB__H */
diff --git a/include/lib/libc/aarch32/string_.h b/include/lib/libc/aarch32/string_.h
index b3ad602..4e139b0 100644
--- a/include/lib/libc/aarch32/string_.h
+++ b/include/lib/libc/aarch32/string_.h
@@ -4,7 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STRING__H
+#define STRING__H
+
 #ifndef SIZET_
 typedef unsigned int size_t;
 #define SIZET_
 #endif
+
+#endif /* STRING__H */
diff --git a/include/lib/libc/aarch32/time_.h b/include/lib/libc/aarch32/time_.h
index 4fc629d..a9169c2 100644
--- a/include/lib/libc/aarch32/time_.h
+++ b/include/lib/libc/aarch32/time_.h
@@ -4,9 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef TIME__H
+#define TIME__H
+
 #ifndef SIZET_
 typedef unsigned int size_t;
 #define SIZET_
 #endif
 
 typedef long int time_t;
+
+#endif /* TIME__H */
diff --git a/include/lib/libc/aarch64/endian_.h b/include/lib/libc/aarch64/endian_.h
index c60b475..7c79fd4 100644
--- a/include/lib/libc/aarch64/endian_.h
+++ b/include/lib/libc/aarch64/endian_.h
@@ -36,8 +36,8 @@
  * All rights reserved.
  */
 
-#ifndef AARCH64_ENDIAN_H
-#define AARCH64_ENDIAN_H
+#ifndef ENDIAN__H
+#define ENDIAN__H
 
 #include <stdint.h>
 
@@ -125,4 +125,4 @@
 #define	__bswap32(x)	__bswap32_var(x)
 
 #endif /* __OPTIMIZE__ */
-#endif /* AARCH64_ENDIAN_H */
+#endif /* ENDIAN__H */
diff --git a/include/lib/libc/aarch64/stddef_.h b/include/lib/libc/aarch64/stddef_.h
index 3e5883e..b7d8209 100644
--- a/include/lib/libc/aarch64/stddef_.h
+++ b/include/lib/libc/aarch64/stddef_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDDEF__H
+#define STDDEF__H
+
 #ifndef SIZET_
 typedef unsigned long size_t;
 #define SIZET_
@@ -13,3 +16,5 @@
 typedef long ptrdiff_t;
 #define _PTRDIFF_T
 #endif
+
+#endif /* STDDEF__H */
diff --git a/include/lib/libc/aarch64/stdio_.h b/include/lib/libc/aarch64/stdio_.h
index ad0b200..09b0172 100644
--- a/include/lib/libc/aarch64/stdio_.h
+++ b/include/lib/libc/aarch64/stdio_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDIO__H
+#define STDIO__H
+
 #ifndef SIZET_
 typedef unsigned long size_t;
 #define SIZET_
@@ -13,3 +16,5 @@
 typedef long ssize_t;
 #define SSIZET_
 #endif
+
+#endif /* STDIO__H */
diff --git a/include/lib/libc/aarch64/stdlib_.h b/include/lib/libc/aarch64/stdlib_.h
index 3612c99..81a39d1 100644
--- a/include/lib/libc/aarch64/stdlib_.h
+++ b/include/lib/libc/aarch64/stdlib_.h
@@ -4,6 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STDLIB__H
+#define STDLIB__H
+
 #ifndef SIZET_
 typedef unsigned long size_t;
 #define SIZET_
@@ -11,3 +14,5 @@
 
 #define EXIT_FAILURE 1
 #define EXIT_SUCCESS 0
+
+#endif /* STDLIB__H */
diff --git a/include/lib/libc/aarch64/string_.h b/include/lib/libc/aarch64/string_.h
index a88a751..71c51a6 100644
--- a/include/lib/libc/aarch64/string_.h
+++ b/include/lib/libc/aarch64/string_.h
@@ -4,7 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef STRING__H
+#define STRING__H
+
 #ifndef SIZET_
 typedef unsigned long size_t;
 #define SIZET_
 #endif
+
+#endif /* STRING__H */
diff --git a/include/lib/libc/aarch64/time_.h b/include/lib/libc/aarch64/time_.h
index cbc34e7..68ab1b8 100644
--- a/include/lib/libc/aarch64/time_.h
+++ b/include/lib/libc/aarch64/time_.h
@@ -4,9 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#ifndef TIME__H
+#define TIME__H
+
 #ifndef SIZET_
 typedef unsigned long size_t;
 #define SIZET_
 #endif
 
 typedef long int time_t;
+
+#endif /* TIME__H */
diff --git a/include/lib/libc/endian.h b/include/lib/libc/endian.h
index 2cc4c5f..4100f57 100644
--- a/include/lib/libc/endian.h
+++ b/include/lib/libc/endian.h
@@ -188,4 +188,4 @@
 	le32enc(p + 4, (uint32_t)(u >> 32));
 }
 
-#endif /* SYS_ENDIAN_H */
+#endif /* ENDIAN_H */
diff --git a/include/lib/mmio.h b/include/lib/mmio.h
index 38fdf0f..3242a7c 100644
--- a/include/lib/mmio.h
+++ b/include/lib/mmio.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __MMIO_H__
-#define __MMIO_H__
+#ifndef MMIO_H
+#define MMIO_H
 
 #include <stdint.h>
 
@@ -73,4 +73,4 @@
 	mmio_write_32(addr, (mmio_read_32(addr) & ~clear) | set);
 }
 
-#endif /* __MMIO_H__ */
+#endif /* MMIO_H */
diff --git a/include/lib/optee_utils.h b/include/lib/optee_utils.h
index 3d35b19..b13c450 100644
--- a/include/lib/optee_utils.h
+++ b/include/lib/optee_utils.h
@@ -3,8 +3,8 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#ifndef __OPTEE_UTILS_H__
-#define __OPTEE_UTILS_H__
+#ifndef OPTEE_UTILS_H
+#define OPTEE_UTILS_H
 
 #include <bl_common.h>
 
@@ -12,4 +12,4 @@
 	image_info_t *pager_image_info,
 	image_info_t *paged_image_info);
 
-#endif /* __OPTEE_UTILS_H__ */
+#endif /* OPTEE_UTILS_H */
diff --git a/include/lib/pmf/pmf_asm_macros.S b/include/lib/pmf/pmf_asm_macros.S
index 5e19e62..5f3e6b7 100644
--- a/include/lib/pmf/pmf_asm_macros.S
+++ b/include/lib/pmf/pmf_asm_macros.S
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __PMF_ASM_MACROS_S__
-#define __PMF_ASM_MACROS_S__
+#ifndef PMF_ASM_MACROS_S
+#define PMF_ASM_MACROS_S
 
 #define PMF_TS_SIZE	8
 
@@ -27,4 +27,4 @@
 	add	x0, x0, x1
 	.endm
 
-#endif /* __PMF_ASM_MACROS_S__ */
+#endif /* PMF_ASM_MACROS_S */
diff --git a/include/lib/runtime_instr.h b/include/lib/runtime_instr.h
index ed564e2..cb64839 100644
--- a/include/lib/runtime_instr.h
+++ b/include/lib/runtime_instr.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __RUNTIME_INSTR_H__
-#define __RUNTIME_INSTR_H__
+#ifndef RUNTIME_INSTR_H
+#define RUNTIME_INSTR_H
 
 #include <utils_def.h>
 
@@ -22,4 +22,4 @@
 PMF_DECLARE_GET_TIMESTAMP(rt_instr_svc)
 #endif /* __ASSEMBLY__ */
 
-#endif /* __RUNTIME_INSTR_H__ */
+#endif /* RUNTIME_INSTR_H */
diff --git a/include/lib/semihosting.h b/include/lib/semihosting.h
index eb7c4c3..006c7b7 100644
--- a/include/lib/semihosting.h
+++ b/include/lib/semihosting.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __SEMIHOSTING_H__
-#define __SEMIHOSTING_H__
+#ifndef SEMIHOSTING_H
+#define SEMIHOSTING_H
 
 #include <stdint.h>
 #include <stdio.h> /* For ssize_t */
@@ -55,4 +55,4 @@
 void semihosting_write_string(char *string);
 char semihosting_read_char(void);
 
-#endif /* __SEMIHOSTING_H__ */
+#endif /* SEMIHOSTING_H */
diff --git a/include/lib/smccc.h b/include/lib/smccc.h
index b3dad10..6ee8aa0 100644
--- a/include/lib/smccc.h
+++ b/include/lib/smccc.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __SMCCC_H__
-#define __SMCCC_H__
+#ifndef SMCCC_H
+#define SMCCC_H
 
 #include <utils_def.h>
 
@@ -101,4 +101,4 @@
 			      (_uuid).node[4], (_uuid).node[5]))
 
 #endif /*__ASSEMBLY__*/
-#endif /* __SMCCC_H__ */
+#endif /* SMCCC_H */
diff --git a/include/lib/smccc_v1.h b/include/lib/smccc_v1.h
index 98ef021..2b8bd8b 100644
--- a/include/lib/smccc_v1.h
+++ b/include/lib/smccc_v1.h
@@ -7,7 +7,7 @@
 #ifndef SMCCC_V1_H
 #define SMCCC_V1_H
 
-#ifndef __SMCCC_H__
+#ifndef SMCCC_H
 #error "This file must only be included from smccc.h"
 #endif
 
diff --git a/include/lib/smccc_v2.h b/include/lib/smccc_v2.h
index 628c160..22bf458 100644
--- a/include/lib/smccc_v2.h
+++ b/include/lib/smccc_v2.h
@@ -7,7 +7,7 @@
 #ifndef SMCCC_V2_H
 #define SMCCC_V2_H
 
-#ifndef __SMCCC_H__
+#ifndef SMCCC_H
 #error "This file must only be included from smccc.h"
 #endif
 
diff --git a/include/lib/utils.h b/include/lib/utils.h
index f324a99..b6ab26e 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __UTILS_H__
-#define __UTILS_H__
+#ifndef UTILS_H
+#define UTILS_H
 
 /*
  * C code should be put in this part of the header to avoid breaking ASM files
@@ -92,4 +92,4 @@
 
 #endif /* !(defined(__LINKER__) || defined(__ASSEMBLY__)) */
 
-#endif /* __UTILS_H__ */
+#endif /* UTILS_H */
diff --git a/include/lib/xlat_tables/xlat_tables_defs.h b/include/lib/xlat_tables/xlat_tables_defs.h
index d260c3e..09baae9 100644
--- a/include/lib/xlat_tables/xlat_tables_defs.h
+++ b/include/lib/xlat_tables/xlat_tables_defs.h
@@ -170,4 +170,4 @@
 #define XN_SHIFT			54
 #define UXN_SHIFT			XN_SHIFT
 
-#endif /* __XLAT_TABLES_DEFS_H__ */
+#endif /* XLAT_TABLES_DEFS_H */
diff --git a/include/lib/zlib/tf_gunzip.h b/include/lib/zlib/tf_gunzip.h
index 46d20eb..741ba50 100644
--- a/include/lib/zlib/tf_gunzip.h
+++ b/include/lib/zlib/tf_gunzip.h
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef __TF_GUNZIP_H__
-#define __TF_GUNZIP_H__
+#ifndef TF_GUNZIP_H
+#define TF_GUNZIP_H
 
 #include <stddef.h>
 #include <stdint.h>
@@ -13,4 +13,4 @@
 int gunzip(uintptr_t *in_buf, size_t in_len, uintptr_t *out_buf,
 	   size_t out_len, uintptr_t work_buf, size_t work_len);
 
-#endif /* __TF_GUNZIP_H___ */
+#endif /* TF_GUNZIP_H */