Commit c3cf06f1 authored by Antonio Nino Diaz's avatar Antonio Nino Diaz
Browse files

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: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
parent f5ae1b0e
......@@ -188,4 +188,4 @@ le64enc(void *pp, uint64_t u)
le32enc(p + 4, (uint32_t)(u >> 32));
}
#endif /* SYS_ENDIAN_H */
#endif /* ENDIAN_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 @@ static inline void mmio_clrsetbits_32(uintptr_t addr,
mmio_write_32(addr, (mmio_read_32(addr) & ~clear) | set);
}
#endif /* __MMIO_H__ */
#endif /* MMIO_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 @@ int parse_optee_header(entry_point_info_t *header_ep,
image_info_t *pager_image_info,
image_info_t *paged_image_info);
#endif /* __OPTEE_UTILS_H__ */
#endif /* OPTEE_UTILS_H */
......@@ -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 */
......@@ -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_CAPTURE_TIMESTAMP(rt_instr_svc)
PMF_DECLARE_GET_TIMESTAMP(rt_instr_svc)
#endif /* __ASSEMBLY__ */
#endif /* __RUNTIME_INSTR_H__ */
#endif /* RUNTIME_INSTR_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_char(char character);
void semihosting_write_string(char *string);
char semihosting_read_char(void);
#endif /* __SEMIHOSTING_H__ */
#endif /* SEMIHOSTING_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 @@ static inline uint32_t smc_uuid_word(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t
(_uuid).node[4], (_uuid).node[5]))
#endif /*__ASSEMBLY__*/
#endif /* __SMCCC_H__ */
#endif /* SMCCC_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
......
......@@ -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
......
......@@ -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 @@ static inline u_register_t load_addr_## _name(void) \
#endif /* !(defined(__LINKER__) || defined(__ASSEMBLY__)) */
#endif /* __UTILS_H__ */
#endif /* UTILS_H */
......@@ -170,4 +170,4 @@
#define XN_SHIFT 54
#define UXN_SHIFT XN_SHIFT
#endif /* __XLAT_TABLES_DEFS_H__ */
#endif /* XLAT_TABLES_DEFS_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 */
......@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __BOARD_CSS_DEF_H__
#define __BOARD_CSS_DEF_H__
#ifndef BOARD_CSS_DEF_H
#define BOARD_CSS_DEF_H
#include <common_def.h>
#include <soc_css_def.h>
......@@ -73,5 +73,4 @@
#define PLAT_ARM_TSP_UART_BASE V2M_IOFPGA_UART0_BASE
#define PLAT_ARM_TSP_UART_CLK_IN_HZ V2M_IOFPGA_UART0_CLK_IN_HZ
#endif /* __BOARD_CSS_DEF_H__ */
#endif /* BOARD_CSS_DEF_H */
......@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __ARM_MACROS_S__
#define __ARM_MACROS_S__
#ifndef ARM_MACROS_S
#define ARM_MACROS_S
#include <gic_common.h>
#include <gicv2.h>
......@@ -91,4 +91,4 @@ gicd_ispendr_loop:
exit_print_gic_regs:
.endm
#endif /* __ARM_MACROS_S__ */
#endif /* ARM_MACROS_S */
......@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __CCI_MACROS_S__
#define __CCI_MACROS_S__
#ifndef CCI_MACROS_S
#define CCI_MACROS_S
#include <cci.h>
#include <platform_def.h>
......@@ -34,4 +34,4 @@ cci_iface_regs:
bl str_in_crash_buf_print
.endm
#endif /* __CCI_MACROS_S__ */
#endif /* CCI_MACROS_S */
......@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __ARM_CONFIG_H__
#define __ARM_CONFIG_H__
#ifndef ARM_CONFIG_H
#define ARM_CONFIG_H
#include <stdint.h>
#include <utils_def.h>
......@@ -39,4 +39,4 @@ static inline const arm_config_t *get_arm_config(void)
}
#endif /* __ARM_CONFIG_H__ */
#endif /* ARM_CONFIG_H */
......@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __ARM_SPM_DEF_H__
#define __ARM_SPM_DEF_H__
#ifndef ARM_SPM_DEF_H
#define ARM_SPM_DEF_H
#include <arm_def.h>
#include <utils_def.h>
......@@ -100,4 +100,4 @@
#define PLAT_SPM_COOKIE_0 ULL(0)
#define PLAT_SPM_COOKIE_1 ULL(0)
#endif /* __ARM_SPM_DEF_H__ */
#endif /* ARM_SPM_DEF_H */
......@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __CSS_MACROS_S__
#define __CSS_MACROS_S__
#ifndef CSS_MACROS_S
#define CSS_MACROS_S
#include <arm_macros.S>
#include <platform_def.h>
......@@ -22,5 +22,4 @@
arm_print_gic_regs
.endm
#endif /* __CSS_MACROS_S__ */
#endif /* CSS_MACROS_S */
......@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __CSS_DEF_H__
#define __CSS_DEF_H__
#ifndef CSS_DEF_H
#define CSS_DEF_H
#include <arm_def.h>
#include <gic_common.h>
......@@ -200,4 +200,4 @@
#define CSS_CPU_PWR_STATE_OFF 0
#define CSS_CPU_PWR_STATE(state, n) (((state) >> (n)) & 1)
#endif /* __CSS_DEF_H__ */
#endif /* CSS_DEF_H */
......@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __CSS_PM_H__
#define __CSS_PM_H__
#ifndef CSS_PM_H
#define CSS_PM_H
#include <cdefs.h>
#include <psci.h>
......@@ -45,4 +45,4 @@ int css_node_hw_state(u_register_t mpidr, unsigned int power_level);
*/
extern const uint32_t plat_css_core_pos_to_scmi_dmn_id_map[];
#endif /* __CSS_PM_H__ */
#endif /* CSS_PM_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment