headers: Fix headers guards
Any word started with underscore followed by and uppercase letter or a second underscore is a reserved word according with C99. With have *many* violations on Zephyr's code, this commit is tackling only the violations caused by headers guards. It also takes the opportunity to normalize them using the filename in uppercase and replacing dot with underscore. e.g file.h -> FILE_H Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
6a68a66726
commit
a7fffa9e00
13 changed files with 38 additions and 38 deletions
|
@ -68,8 +68,8 @@
|
|||
* 0000000c A ___kernel_t_idle_OFFSET
|
||||
*/
|
||||
|
||||
#ifndef _GEN_OFFSET_H
|
||||
#define _GEN_OFFSET_H
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_GEN_OFFSET_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_GEN_OFFSET_H_
|
||||
|
||||
#include <toolchain.h>
|
||||
#include <stddef.h>
|
||||
|
@ -79,4 +79,4 @@
|
|||
#define GEN_OFFSET_SYM(S, M) \
|
||||
GEN_ABSOLUTE_SYM(__##S##_##M##_##OFFSET, offsetof(S, M))
|
||||
|
||||
#endif /* _GEN_OFFSET_H */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_GEN_OFFSET_H_ */
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
* This file contains private kernel APIs that are not architecture-specific.
|
||||
*/
|
||||
|
||||
#ifndef _NANO_INTERNAL__H_
|
||||
#define _NANO_INTERNAL__H_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_KERNEL_INTERNAL_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_KERNEL_INTERNAL_H_
|
||||
|
||||
#include <kernel.h>
|
||||
|
||||
|
@ -232,4 +232,4 @@ extern int z_stack_adjust_initialized;
|
|||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _NANO_INTERNAL__H_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_INTERNAL_H_ */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
#include <device.h>
|
||||
|
||||
#ifndef _kernel_offsets__h_
|
||||
#define _kernel_offsets__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_
|
||||
|
||||
#include <syscall_list.h>
|
||||
|
||||
|
@ -80,4 +80,4 @@ GEN_ABSOLUTE_SYM(K_THREAD_SIZEOF, sizeof(struct k_thread));
|
|||
/* size of the device structure. Used by linker scripts */
|
||||
GEN_ABSOLUTE_SYM(_DEVICE_STRUCT_SIZE, sizeof(struct device));
|
||||
|
||||
#endif /* _kernel_offsets__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_ */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _kernel_structs__h_
|
||||
#define _kernel_structs__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_KERNEL_STRUCTS_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_KERNEL_STRUCTS_H_
|
||||
|
||||
#include <kernel.h>
|
||||
|
||||
|
@ -248,4 +248,4 @@ static ALWAYS_INLINE void _new_thread_init(struct k_thread *thread,
|
|||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _kernel_structs__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_STRUCTS_H_ */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _ksched__h_
|
||||
#define _ksched__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_KSCHED_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_KSCHED_H_
|
||||
|
||||
#include <kernel_structs.h>
|
||||
#include <tracing.h>
|
||||
|
@ -287,4 +287,4 @@ static inline struct k_thread *_unpend1_no_timeout(_wait_q_t *wait_q)
|
|||
return thread;
|
||||
}
|
||||
|
||||
#endif /* _ksched__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_KSCHED_H_ */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _KSWAP_H
|
||||
#define _KSWAP_H
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_KSWAP_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_KSWAP_H_
|
||||
|
||||
#include <ksched.h>
|
||||
#include <kernel_arch_func.h>
|
||||
|
@ -110,4 +110,4 @@ static inline int _Swap(unsigned int key)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* _KSWAP_H */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_KSWAP_H_ */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _offsets_short__h_
|
||||
#define _offsets_short__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
|
||||
|
||||
#include <offsets.h>
|
||||
#include <offsets_short_arch.h>
|
||||
|
@ -64,4 +64,4 @@
|
|||
|
||||
/* end - threads */
|
||||
|
||||
#endif /* _offsets_short__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_ */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef _ZEPHYR_SYSCALL_HANDLER_H_
|
||||
#define _ZEPHYR_SYSCALL_HANDLER_H_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_SYSCALL_HANDLER_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_SYSCALL_HANDLER_H_
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
|
||||
|
@ -605,4 +605,4 @@ static inline int _obj_validation_check(struct _k_object *ko,
|
|||
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
|
||||
#endif /* _ZEPHYR_SYSCALL_H_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_SYSCALL_HANDLER_H_ */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _kernel_include_timeout_q__h_
|
||||
#define _kernel_include_timeout_q__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_TIMEOUT_Q_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_TIMEOUT_Q_H_
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -290,4 +290,4 @@ static inline s32_t _get_next_timeout_expiry(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* _kernel_include_timeout_q__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_TIMEOUT_Q_H_ */
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _kernel_include_wait_q__h_
|
||||
#define _kernel_include_wait_q__h_
|
||||
#ifndef ZEPHYR_KERNEL_INCLUDE_WAIT_Q_H_
|
||||
#define ZEPHYR_KERNEL_INCLUDE_WAIT_Q_H_
|
||||
|
||||
#include <kernel_structs.h>
|
||||
#include <misc/dlist.h>
|
||||
|
@ -85,4 +85,4 @@ static inline struct k_thread *_waitq_head(_wait_q_t *w)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* _kernel_include_wait_q__h_ */
|
||||
#endif /* ZEPHYR_KERNEL_INCLUDE_WAIT_Q_H_ */
|
||||
|
|
|
@ -659,8 +659,8 @@ def output_include_lines(fd, fixups):
|
|||
fd.write(" * DO NOT MODIFY\n")
|
||||
fd.write(" */\n")
|
||||
fd.write("\n")
|
||||
fd.write("#ifndef _DEVICE_TREE_BOARD_H" + "\n")
|
||||
fd.write("#define _DEVICE_TREE_BOARD_H" + "\n")
|
||||
fd.write("#ifndef DEVICE_TREE_BOARD_H" + "\n")
|
||||
fd.write("#define DEVICE_TREE_BOARD_H" + "\n")
|
||||
fd.write("\n")
|
||||
|
||||
node_keys = sorted(defs.keys())
|
||||
|
|
|
@ -154,8 +154,8 @@ driver_macro_tpl = """
|
|||
|
||||
|
||||
def write_validation_output(fp):
|
||||
fp.write("#ifndef __DRIVER_VALIDATION_GEN_H__\n")
|
||||
fp.write("#define __DRIVER_VALIDATION_GEN_H__\n")
|
||||
fp.write("#ifndef DRIVER_VALIDATION_GEN_H\n")
|
||||
fp.write("#define DRIVER_VALIDATION_GEN_H\n")
|
||||
|
||||
fp.write("""#define Z_SYSCALL_DRIVER_GEN(ptr, op, driver_lower_case, driver_upper_case) \\
|
||||
(Z_SYSCALL_OBJ(ptr, K_OBJ_DRIVER_##driver_upper_case) || \\
|
||||
|
@ -170,7 +170,7 @@ def write_validation_output(fp):
|
|||
"driver_upper": subsystem.upper(),
|
||||
})
|
||||
|
||||
fp.write("#endif /* __DRIVER_VALIDATION_GEN_H__ */\n")
|
||||
fp.write("#endif /* DRIVER_VALIDATION_GEN_H */\n")
|
||||
|
||||
|
||||
def write_kobj_types_output(fp):
|
||||
|
|
|
@ -24,8 +24,8 @@ const _k_syscall_handler_t _k_syscall_table[K_SYSCALL_LIMIT] = {
|
|||
|
||||
list_template = """
|
||||
/* auto-generated by gen_syscalls.py, don't edit */
|
||||
#ifndef _ZEPHYR_SYSCALL_LIST_H_
|
||||
#define _ZEPHYR_SYSCALL_LIST_H_
|
||||
#ifndef ZEPHYR_SYSCALL_LIST_H
|
||||
#define ZEPHYR_SYSCALL_LIST_H
|
||||
|
||||
%s
|
||||
|
||||
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _ZEPHYR_SYSCALL_LIST_H_ */
|
||||
#endif /* ZEPHYR_SYSCALL_LIST_H */
|
||||
"""
|
||||
|
||||
syscall_template = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue