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/plat/mediatek/common/custom/oem_svc.h b/plat/mediatek/common/custom/oem_svc.h
index 636bb87..76f7c24 100644
--- a/plat/mediatek/common/custom/oem_svc.h
+++ b/plat/mediatek/common/custom/oem_svc.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __OEM_SVC_H__
-#define __OEM_SVC_H__
+#ifndef OEM_SVC_H
+#define OEM_SVC_H
/*******************************************************************************
* Defines for runtime services func ids
@@ -41,4 +41,4 @@
#define OEM_SVC_E_NOT_SUPPORTED -1
#define OEM_SVC_E_INVALID_PARAMS -2
-#endif /* __OEM_SVC_H__ */
+#endif /* OEM_SVC_H */
diff --git a/plat/mediatek/common/drivers/uart/uart8250.h b/plat/mediatek/common/drivers/uart/uart8250.h
index 8204d3f..da7c7a1 100644
--- a/plat/mediatek/common/drivers/uart/uart8250.h
+++ b/plat/mediatek/common/drivers/uart/uart8250.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __UART8250_H__
-#define __UART8250_H__
+#ifndef UART8250_H
+#define UART8250_H
/* UART register */
#define UART_RBR 0x00 /* Receive buffer register */
@@ -35,4 +35,4 @@
#define UART_LSR_DR 0x01 /* Data ready */
#define UART_LSR_THRE 0x20 /* Xmit holding register empty */
-#endif /* __UART8250_H__ */
+#endif /* UART8250_H */
diff --git a/plat/mediatek/common/mtk_plat_common.h b/plat/mediatek/common/mtk_plat_common.h
index 923cf69..ff8e8c0 100644
--- a/plat/mediatek/common/mtk_plat_common.h
+++ b/plat/mediatek/common/mtk_plat_common.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MTK_PLAT_COMMON_H__
-#define __MTK_PLAT_COMMON_H__
+#ifndef MTK_PLAT_COMMON_H
+#define MTK_PLAT_COMMON_H
#include <bl_common.h>
#include <param_header.h>
@@ -74,4 +74,4 @@
uint64_t get_kernel_info_r2(void);
extern struct atf_arg_t gteearg;
-#endif
+#endif /* MTK_PLAT_COMMON_H */
diff --git a/plat/mediatek/common/mtk_sip_svc.h b/plat/mediatek/common/mtk_sip_svc.h
index 1572ba7..cd4096e 100644
--- a/plat/mediatek/common/mtk_sip_svc.h
+++ b/plat/mediatek/common/mtk_sip_svc.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_SIP_SVC_H__
-#define __PLAT_SIP_SVC_H__
+#ifndef MTK_SIP_SVC_H
+#define MTK_SIP_SVC_H
#include <stdint.h>
@@ -50,4 +50,4 @@
*/
uint64_t mt_sip_set_authorized_sreg(uint32_t sreg, uint32_t val);
-#endif /* __PLAT_SIP_SVC_H__ */
+#endif /* MTK_SIP_SVC_H */
diff --git a/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.h b/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.h
index 99b78a7..84df081 100644
--- a/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.h
+++ b/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MT_CPUXGPT_H__
-#define __MT_CPUXGPT_H__
+#ifndef MT_CPUXGPT_H
+#define MT_CPUXGPT_H
/* REG */
#define INDEX_CTL_REG 0x000
@@ -25,4 +25,4 @@
void sched_clock_init(uint64_t normal_base, uint64_t atf_base);
uint64_t sched_clock(void);
-#endif /* __MT_CPUXGPT_H__ */
+#endif /* MT_CPUXGPT_H */
diff --git a/plat/mediatek/mt6795/include/mcucfg.h b/plat/mediatek/mt6795/include/mcucfg.h
index eff8d34..7f6a786 100644
--- a/plat/mediatek/mt6795/include/mcucfg.h
+++ b/plat/mediatek/mt6795/include/mcucfg.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MCUCFG_H__
-#define __MCUCFG_H__
+#ifndef MCUCFG_H
+#define MCUCFG_H
#include <platform_def.h>
#include <stdint.h>
@@ -151,4 +151,4 @@
MP1_L2RSTDISABLE = 1 << MP1_L2RSTDISABLE_SHIFT
};
-#endif /* __MCUCFG_H__ */
+#endif /* MCUCFG_H */
diff --git a/plat/mediatek/mt6795/include/plat_private.h b/plat/mediatek/mt6795/include/plat_private.h
index 9c6c1f0..10baa23 100644
--- a/plat/mediatek/mt6795/include/plat_private.h
+++ b/plat/mediatek/mt6795/include/plat_private.h
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_PRIVATE_H__
-#define __PLAT_PRIVATE_H__
+#ifndef PLAT_PRIVATE_H
+#define PLAT_PRIVATE_H
+
#include <stdint.h>
#include <xlat_tables.h>
@@ -33,4 +34,4 @@
void plat_mt_gic_cpuif_disable(void);
void plat_mt_gic_pcpu_init(void);
-#endif /* __PLAT_PRIVATE_H__ */
+#endif /* PLAT_PRIVATE_H */
diff --git a/plat/mediatek/mt6795/include/plat_sip_calls.h b/plat/mediatek/mt6795/include/plat_sip_calls.h
index b328195..b9a1363 100644
--- a/plat/mediatek/mt6795/include/plat_sip_calls.h
+++ b/plat/mediatek/mt6795/include/plat_sip_calls.h
@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_SIP_CALLS_H__
-#define __PLAT_SIP_CALLS_H__
+#ifndef PLAT_SIP_CALLS_H
+#define PLAT_SIP_CALLS_H
/*******************************************************************************
* Plat SiP function constants
******************************************************************************/
#define MTK_PLAT_SIP_NUM_CALLS 0
-#endif /* __PLAT_SIP_CALLS_H__ */
+#endif /* PLAT_SIP_CALLS_H */
diff --git a/plat/mediatek/mt6795/include/power_tracer.h b/plat/mediatek/mt6795/include/power_tracer.h
index 5eb77e4..8c98dbd 100644
--- a/plat/mediatek/mt6795/include/power_tracer.h
+++ b/plat/mediatek/mt6795/include/power_tracer.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __POWER_TRACER_H__
-#define __POWER_TRACER_H__
+#ifndef POWER_TRACER_H
+#define POWER_TRACER_H
#define CPU_UP 0
#define CPU_DOWN 1
@@ -16,4 +16,4 @@
void trace_power_flow(unsigned long mpidr, unsigned char mode);
-#endif
+#endif /* POWER_TRACER_H */
diff --git a/plat/mediatek/mt6795/include/scu.h b/plat/mediatek/mt6795/include/scu.h
index 3c78692..625418a 100644
--- a/plat/mediatek/mt6795/include/scu.h
+++ b/plat/mediatek/mt6795/include/scu.h
@@ -4,10 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SCU_H__
-#define __SCU_H__
+#ifndef SCU_H
+#define SCU_H
void disable_scu(unsigned long mpidr);
void enable_scu(unsigned long mpidr);
-#endif
+#endif /* SCU_H */
diff --git a/plat/mediatek/mt6795/include/spm.h b/plat/mediatek/mt6795/include/spm.h
index 5e31276..5227e1d 100644
--- a/plat/mediatek/mt6795/include/spm.h
+++ b/plat/mediatek/mt6795/include/spm.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SPM_H__
-#define __SPM_H__
+#ifndef SPM_H
+#define SPM_H
#define SPM_POWERON_CONFIG_SET (SPM_BASE + 0x000)
#define SPM_POWER_ON_VAL0 (SPM_BASE + 0x010)
@@ -195,4 +195,4 @@
#define WAKE_SRC_ALL_MD32 (1 << 28)
#define WAKE_SRC_CPU_IRQ (1 << 29)
-#endif /* __SPM_H__ */
+#endif /* SPM_H */
diff --git a/plat/mediatek/mt8173/drivers/crypt/crypt.h b/plat/mediatek/mt8173/drivers/crypt/crypt.h
index 3bbc168..1a691a6 100644
--- a/plat/mediatek/mt8173/drivers/crypt/crypt.h
+++ b/plat/mediatek/mt8173/drivers/crypt/crypt.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __CRYPT_H__
-#define __CRYPT_H__
+#ifndef CRYPT_H
+#define CRYPT_H
#include <stdint.h>
@@ -13,4 +13,4 @@
uint64_t crypt_set_hdcp_key_num(uint32_t num);
uint64_t crypt_clear_hdcp_key(void);
-#endif /* __CRYPT_H__ */
+#endif /* CRYPT_H */
diff --git a/plat/mediatek/mt8173/drivers/mtcmos/mtcmos.h b/plat/mediatek/mt8173/drivers/mtcmos/mtcmos.h
index 6e14e3d..1e58027 100644
--- a/plat/mediatek/mt8173/drivers/mtcmos/mtcmos.h
+++ b/plat/mediatek/mt8173/drivers/mtcmos/mtcmos.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MTCMOS_H__
-#define __MTCMOS_H__
+#ifndef MTCMOS_H
+#define MTCMOS_H
/*
* This function will turn off all the little core's power except cpu 0. The
@@ -15,4 +15,4 @@
void mtcmos_little_cpu_off(void);
uint32_t mtcmos_non_cpu_ctrl(uint32_t on, uint32_t mtcmos_num);
-#endif /* __MTCMOS_H__ */
+#endif /* MTCMOS_H */
diff --git a/plat/mediatek/mt8173/drivers/pmic/pmic_wrap_init.h b/plat/mediatek/mt8173/drivers/pmic/pmic_wrap_init.h
index 01f1b25..0f09771 100644
--- a/plat/mediatek/mt8173/drivers/pmic/pmic_wrap_init.h
+++ b/plat/mediatek/mt8173/drivers/pmic/pmic_wrap_init.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PMIC_WRAP_INIT_H__
-#define __PMIC_WRAP_INIT_H__
+#ifndef PMIC_WRAP_INIT_H
+#define PMIC_WRAP_INIT_H
/* external API */
int32_t pwrap_read(uint32_t adr, uint32_t *rdata);
@@ -164,4 +164,4 @@
E_PWR_SWITCH_DIO = 32
};
-#endif /* __PMIC_WRAP_INIT_H__ */
+#endif /* PMIC_WRAP_INIT_H */
diff --git a/plat/mediatek/mt8173/drivers/rtc/rtc.h b/plat/mediatek/mt8173/drivers/rtc/rtc.h
index d4f8a56..9c4ca49 100644
--- a/plat/mediatek/mt8173/drivers/rtc/rtc.h
+++ b/plat/mediatek/mt8173/drivers/rtc/rtc.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_DRIVER_RTC_H__
-#define __PLAT_DRIVER_RTC_H__
+#ifndef RTC_H
+#define RTC_H
/* RTC registers */
enum {
@@ -51,4 +51,4 @@
void rtc_bbpu_power_down(void);
-#endif /* __PLAT_DRIVER_RTC_H__ */
+#endif /* RTC_H */
diff --git a/plat/mediatek/mt8173/drivers/spm/spm.h b/plat/mediatek/mt8173/drivers/spm/spm.h
index abbee2f..403303a 100644
--- a/plat/mediatek/mt8173/drivers/spm/spm.h
+++ b/plat/mediatek/mt8173/drivers/spm/spm.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SPM_H__
-#define __SPM_H__
+#ifndef SPM_H
+#define SPM_H
#define SPM_POWERON_CONFIG_SET (SPM_BASE + 0x000)
#define SPM_POWER_ON_VAL0 (SPM_BASE + 0x010)
@@ -333,4 +333,4 @@
void spm_lock_release(void);
void spm_boot_init(void);
-#endif /* __SPM_H__ */
+#endif /* SPM_H */
diff --git a/plat/mediatek/mt8173/drivers/spm/spm_hotplug.h b/plat/mediatek/mt8173/drivers/spm/spm_hotplug.h
index 8ebf5c4..00849a2 100644
--- a/plat/mediatek/mt8173/drivers/spm/spm_hotplug.h
+++ b/plat/mediatek/mt8173/drivers/spm/spm_hotplug.h
@@ -3,11 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SPM_HOTPLUG_H__
-#define __SPM_HOTPLUG_H__
+#ifndef SPM_HOTPLUG_H
+#define SPM_HOTPLUG_H
void spm_clear_hotplug(void);
void spm_hotplug_off(unsigned long mpidr);
void spm_hotplug_on(unsigned long mpidr);
-#endif /* __SPM_HOTPLUG_H__ */
+#endif /* SPM_HOTPLUG_H */
diff --git a/plat/mediatek/mt8173/drivers/spm/spm_mcdi.h b/plat/mediatek/mt8173/drivers/spm/spm_mcdi.h
index e29f565..7f3f96e 100644
--- a/plat/mediatek/mt8173/drivers/spm/spm_mcdi.h
+++ b/plat/mediatek/mt8173/drivers/spm/spm_mcdi.h
@@ -3,12 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SPM_MCDI_H__
-#define __SPM_MCDI_H__
+#ifndef SPM_MCDI_H
+#define SPM_MCDI_H
void spm_mcdi_wakeup_all_cores(void);
void spm_mcdi_prepare_for_mtcmos(void);
void spm_mcdi_prepare_for_off_state(unsigned long mpidr, unsigned int afflvl);
void spm_mcdi_finish_for_on_state(unsigned long mpidr, unsigned int afflvl);
-#endif /* __SPM_MCDI_H__ */
+#endif /* SPM_MCDI_H */
diff --git a/plat/mediatek/mt8173/drivers/spm/spm_suspend.h b/plat/mediatek/mt8173/drivers/spm/spm_suspend.h
index 4041cfe..b00faa9 100644
--- a/plat/mediatek/mt8173/drivers/spm/spm_suspend.h
+++ b/plat/mediatek/mt8173/drivers/spm/spm_suspend.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SPM_SUSPEND_H__
-#define __SPM_SUSPEND_H__
+#ifndef SPM_SUSPEND_H
+#define SPM_SUSPEND_H
/* cpu dormant return code */
#define CPU_DORMANT_RESET 0
@@ -13,4 +13,4 @@
void spm_system_suspend(void);
void spm_system_suspend_finish(void);
-#endif /* __SPM_SUSPEND_H__*/
+#endif /* SPM_SUSPEND_H*/
diff --git a/plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.h b/plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.h
index 0364bba..8c0fe83 100644
--- a/plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.h
+++ b/plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MT_CPUXGPT_H__
-#define __MT_CPUXGPT_H__
+#ifndef MT_CPUXGPT_H
+#define MT_CPUXGPT_H
/* REG */
#define INDEX_CNT_L_INIT 0x008
@@ -13,4 +13,4 @@
void generic_timer_backup(void);
-#endif /* __MT_CPUXGPT_H__ */
+#endif /* MT_CPUXGPT_H */
diff --git a/plat/mediatek/mt8173/include/mcucfg.h b/plat/mediatek/mt8173/include/mcucfg.h
index 355c276..49d7c3e 100644
--- a/plat/mediatek/mt8173/include/mcucfg.h
+++ b/plat/mediatek/mt8173/include/mcucfg.h
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MCUCFG_H__
-#define __MCUCFG_H__
+#ifndef MCUCFG_H
+#define MCUCFG_H
#include <mt8173_def.h>
#include <stdint.h>
@@ -216,4 +216,4 @@
ACLK_EMI_DYNAMIC_CG_EN | ACLK_INFRA_DYNAMIC_CG_EN,
};
-#endif /* __MCUCFG_H__ */
+#endif /* MCUCFG_H */
diff --git a/plat/mediatek/mt8173/include/mt8173_def.h b/plat/mediatek/mt8173/include/mt8173_def.h
index 3289de4..58962f0 100644
--- a/plat/mediatek/mt8173/include/mt8173_def.h
+++ b/plat/mediatek/mt8173/include/mt8173_def.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __MT8173_DEF_H__
-#define __MT8173_DEF_H__
+#ifndef MT8173_DEF_H
+#define MT8173_DEF_H
#if RESET_TO_BL31
#error "MT8173 is incompatible with RESET_TO_BL31!"
@@ -149,4 +149,4 @@
mtk_make_pwrstate_lvl1(lvl1_state, lvl0_state, pwr_lvl, type))
-#endif /* __MT8173_DEF_H__ */
+#endif /* MT8173_DEF_H */
diff --git a/plat/mediatek/mt8173/include/plat_private.h b/plat/mediatek/mt8173/include/plat_private.h
index 87ffbfc..cd92d34 100644
--- a/plat/mediatek/mt8173/include/plat_private.h
+++ b/plat/mediatek/mt8173/include/plat_private.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_PRIVATE_H__
-#define __PLAT_PRIVATE_H__
+#ifndef PLAT_PRIVATE_H
+#define PLAT_PRIVATE_H
/*******************************************************************************
* Function and variable prototypes
@@ -24,4 +24,4 @@
/* Declarations for plat_topology.c */
int mt_setup_topology(void);
-#endif /* __PLAT_PRIVATE_H__ */
+#endif /* PLAT_PRIVATE_H */
diff --git a/plat/mediatek/mt8173/include/plat_sip_calls.h b/plat/mediatek/mt8173/include/plat_sip_calls.h
index 2593709..88202cc 100644
--- a/plat/mediatek/mt8173/include/plat_sip_calls.h
+++ b/plat/mediatek/mt8173/include/plat_sip_calls.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __PLAT_SIP_CALLS_H__
-#define __PLAT_SIP_CALLS_H__
+#ifndef PLAT_SIP_CALLS_H
+#define PLAT_SIP_CALLS_H
/*******************************************************************************
* Plat SiP function constants
@@ -19,4 +19,4 @@
#define MTK_SIP_CLR_HDCP_KEY 0x82000406
#define MTK_SIP_SET_HDCP_KEY_EX 0x82000407
-#endif /* __PLAT_SIP_CALLS_H__ */
+#endif /* PLAT_SIP_CALLS_H */
diff --git a/plat/mediatek/mt8173/include/power_tracer.h b/plat/mediatek/mt8173/include/power_tracer.h
index e8c0552..195366d 100644
--- a/plat/mediatek/mt8173/include/power_tracer.h
+++ b/plat/mediatek/mt8173/include/power_tracer.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __POWER_TRACER_H__
-#define __POWER_TRACER_H__
+#ifndef POWER_TRACER_H
+#define POWER_TRACER_H
#define CPU_UP 0
#define CPU_DOWN 1
@@ -16,4 +16,4 @@
void trace_power_flow(unsigned long mpidr, unsigned char mode);
-#endif
+#endif /* POWER_TRACER_H */
diff --git a/plat/mediatek/mt8173/include/scu.h b/plat/mediatek/mt8173/include/scu.h
index 2ce4b23..b1e9424 100644
--- a/plat/mediatek/mt8173/include/scu.h
+++ b/plat/mediatek/mt8173/include/scu.h
@@ -4,10 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef __SCU_H__
-#define __SCU_H__
+#ifndef SCU_H
+#define SCU_H
void disable_scu(unsigned long mpidr);
void enable_scu(unsigned long mpidr);
-#endif
+#endif /* SCU_H */