All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs/misra: add R16.2 and R16.3
@ 2023-11-14 23:12 Stefano Stabellini
  0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2023-11-14 23:12 UTC (permalink / raw)
  To: xen-devel
  Cc: sstabellini, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Bertrand Marquis, Julien Grall

For Rule 16.2 deviate xen/arch/x86/x86_emulate.
For Rule 16.2 allow control flow statements and terminals. For the rest,
request the "fallthrough" psedo-keyword to be used.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/rules.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 375a886607..926ecc9d82 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -462,6 +462,20 @@ maintainers if you want to suggest a change.
 
        while(0) and while(1) and alike are allowed.
 
+   * - `Rule 16.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_02.c>`_
+     - Required
+     - A switch label shall only be used when the most closely-enclosing
+       compound statement is the body of a switch statement
+     - xen/arch/x86/x86_emulate/ doesn't follow this guideline
+
+   * - `Rule 16.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_03.c>`_
+     - Required
+     - An unconditional break statement shall terminate every
+       switch-clause
+     - Control flow statements (goto, return, continue) and terminals
+       (BUG()) are permitted. Other cases shall have the pseudo-keyword
+       "fallthrough".
+
    * - `Rule 16.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_07.c>`_
      - Required
      - A switch-expression shall not have essentially Boolean type
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-14 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-14 23:12 [PATCH] docs/misra: add R16.2 and R16.3 Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.