mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
misra: modify deviations for empty and generated headers
This patch modifies deviations for Directive 4.10: "Precautions shall be taken in order to prevent the contents of a header file being included more than once" This patch avoids the file-based deviation for empty headers, and replaces it with a comment-based one using the format specified in docs/misra/safe.json. Generated headers are not generally safe against multi-inclusions, whether a header is safe depends on the nature of the generated code in the header. For that reason, this patch drops the deviation for generated headers. Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
This commit is contained in:
1 parent
d2ff674a9c
commit
79b9c0cdd8
4 files changed
+10
-8
No files matched your search
@@ -72,13 +72,6 @@ they are not instances of commented-out code."
|
||||
-config=MC3R1.D4.3,reports+={deliberate, "any_area(any_loc(file(arm64_bitops))&&context(name(int_clear_mask16)))"}
|
||||
-doc_end
|
||||
|
||||
-doc_begin="This header file is autogenerated or empty, therefore it poses no
|
||||
risk if included more than once."
|
||||
-file_tag+={empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
|
||||
-file_tag+={autogen_headers, "^xen/include/xen/compile\\.h$||^xen/include/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
|
||||
-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(file(empty_header||autogen_headers)))"}
|
||||
-doc_end
|
||||
|
||||
-doc_begin="Files that are intended to be included more than once do not need to
|
||||
conform to the directive."
|
||||
-config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"}
|
||||
|
||||