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/scripts/dts/extract_dts_includes.py b/scripts/dts/extract_dts_includes.py index 274d156..56d57e3 100755 --- a/scripts/dts/extract_dts_includes.py +++ b/scripts/dts/extract_dts_includes.py
@@ -659,8 +659,8 @@ 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())
diff --git a/scripts/gen_kobject_list.py b/scripts/gen_kobject_list.py index 8ec86cd..e0384c9 100755 --- a/scripts/gen_kobject_list.py +++ b/scripts/gen_kobject_list.py
@@ -154,8 +154,8 @@ 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 @@ "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):
diff --git a/scripts/gen_syscalls.py b/scripts/gen_syscalls.py index ad90629..e385f94 100755 --- a/scripts/gen_syscalls.py +++ b/scripts/gen_syscalls.py
@@ -24,8 +24,8 @@ 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 @@ #endif /* _ASMLANGUAGE */ -#endif /* _ZEPHYR_SYSCALL_LIST_H_ */ +#endif /* ZEPHYR_SYSCALL_LIST_H */ """ syscall_template = """