[prev in list] [next in list] [prev in thread] [next in thread]
List: xen-cvs
Subject: [xen master] docs/misra: add rule 2.1 exceptions
From: patchbot () xen ! org
Date: 2023-09-30 21:58:01
Message-ID: E1qmi0v-0000o3-UV () xenbits ! xenproject ! org
[Download RAW message or body]
commit 5bdfcf7fe89759321335159c8304833dc32a25cd
Author: Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Aug 23 15:39:42 2023 -0700
Commit: Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Sep 29 11:00:47 2023 -0700
docs/misra: add rule 2.1 exceptions
During the discussions that led to the acceptance of Rule 2.1, we
decided on a few exceptions that were not properly recorded in
rules.rst. Add them now.
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
---
docs/misra/rules.rst | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 661aa95e23..a2fe01464e 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -107,7 +107,16 @@ maintainers if you want to suggest a change.
* - `Rule 2.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_01_1.c>`_
- Required
- A project shall not contain unreachable code
- -
+ - The following are allowed:
+ - Invariantly constant conditions, e.g. if(IS_ENABLED(CONFIG_HVM)) { S; }
+ - Switch with a controlling value statically determined not to
+ match one or more case statements
+ - Functions that are intended to be referenced only from
+ assembly code (e.g. 'do_trap_fiq')
+ - asm-offsets.c, as they are not linked deliberately, because
+ they are used to generate definitions for asm modules
+ - Declarations without initializer are safe, as they are not
+ executed
* - `Rule 2.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_06.c>`_
- Advisory
--
generated by git-patchbot for /home/xen/git/xen.git#master
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic