Add deviation comments to address violations of
MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order
to prevent the contents of a header file being included more than
once").
Inclusion guards must appear at the beginning of the headers
(comments are permitted anywhere).
This patch adds deviation comments using the format specified
in docs/misra/safe.json for headers with just the direct
inclusion guard before the inclusion guard since they are
safe and not supposed to comply with the directive.
Note that with SAF-10-safe in place, failures to have proper guards later
in the header files will not be reported
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
},
{
"id": "SAF-10-safe",
+ "analyser": {
+ "eclair": "MC3R1.D4.10"
+ },
+ "name": "Dir 4.10: direct inclusion guard before",
+ "text": "Headers with just the direct inclusion guard before the inclusion guard are safe."
+ },
+ {
+ "id": "SAF-11-safe",
"analyser": {},
"name": "Sentinel",
"text": "Next ID to be used"
+/* SAF-10-safe direct inclusion guard before */
#ifndef __XEN_HYPERCALL_H__
#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
#endif
* asm-x86/hypercall.h
*/
+/* SAF-10-safe direct inclusion guard before */
#ifndef __XEN_HYPERCALL_H__
#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
#endif