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>
diff --git a/kernel/include/gen_offset.h b/kernel/include/gen_offset.h
index 0fd71a3..1fa1da5 100644
--- a/kernel/include/gen_offset.h
+++ b/kernel/include/gen_offset.h
@@ -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_ */
diff --git a/kernel/include/kernel_internal.h b/kernel/include/kernel_internal.h
index a908783..9b15c59 100644
--- a/kernel/include/kernel_internal.h
+++ b/kernel/include/kernel_internal.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 @@
#endif /* _ASMLANGUAGE */
-#endif /* _NANO_INTERNAL__H_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_INTERNAL_H_ */
diff --git a/kernel/include/kernel_offsets.h b/kernel/include/kernel_offsets.h
index a3a8b1e..d129f7d 100644
--- a/kernel/include/kernel_offsets.h
+++ b/kernel/include/kernel_offsets.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 @@
/* 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_ */
diff --git a/kernel/include/kernel_structs.h b/kernel/include/kernel_structs.h
index 505da0b..96b1f5f 100644
--- a/kernel/include/kernel_structs.h
+++ b/kernel/include/kernel_structs.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 @@
#endif /* _ASMLANGUAGE */
-#endif /* _kernel_structs__h_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_STRUCTS_H_ */
diff --git a/kernel/include/ksched.h b/kernel/include/ksched.h
index 93bf6bb..89911c1 100644
--- a/kernel/include/ksched.h
+++ b/kernel/include/ksched.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 @@
return thread;
}
-#endif /* _ksched__h_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_KSCHED_H_ */
diff --git a/kernel/include/kswap.h b/kernel/include/kswap.h
index 01ac1f0..7096ad7 100644
--- a/kernel/include/kswap.h
+++ b/kernel/include/kswap.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 @@
}
#endif
-#endif /* _KSWAP_H */
+#endif /* ZEPHYR_KERNEL_INCLUDE_KSWAP_H_ */
diff --git a/kernel/include/offsets_short.h b/kernel/include/offsets_short.h
index ac73d15..bd49074 100644
--- a/kernel/include/offsets_short.h
+++ b/kernel/include/offsets_short.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_ */
diff --git a/kernel/include/syscall_handler.h b/kernel/include/syscall_handler.h
index a0d5950..f2d2384 100644
--- a/kernel/include/syscall_handler.h
+++ b/kernel/include/syscall_handler.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 @@
#endif /* CONFIG_USERSPACE */
-#endif /* _ZEPHYR_SYSCALL_H_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_SYSCALL_HANDLER_H_ */
diff --git a/kernel/include/timeout_q.h b/kernel/include/timeout_q.h
index e911a7d..f290e9b 100644
--- a/kernel/include/timeout_q.h
+++ b/kernel/include/timeout_q.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 @@
}
#endif
-#endif /* _kernel_include_timeout_q__h_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_TIMEOUT_Q_H_ */
diff --git a/kernel/include/wait_q.h b/kernel/include/wait_q.h
index 6aea2d3..fadc255 100644
--- a/kernel/include/wait_q.h
+++ b/kernel/include/wait_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 @@
}
#endif
-#endif /* _kernel_include_wait_q__h_ */
+#endif /* ZEPHYR_KERNEL_INCLUDE_WAIT_Q_H_ */