diff mbox series

[v2,2/2] docs/misra: add Rule 5.1

Message ID 20220601014402.2293524-2-sstabellini@kernel.org (mailing list archive)
State New, archived
Headers show
Series introduce docs/misra/rules.rst | expand

Commit Message

Stefano Stabellini June 1, 2022, 1:44 a.m. UTC
From: Stefano Stabellini <stefano.stabellini@xilinx.com>

Add Rule 5.1, with the additional note that the character limit for Xen
is 40 characters.

The max length identifiers found by ECLAIR are:

__mitigate_spectre_bhb_clear_insn_start
domain_pause_by_systemcontroller_nosync

Both of them are 40 characters long.

Explicitly mention that public headers might have longer identifiers.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---

Changes in v2:
- lower the limit to 40
- mention public headers
- improve commit message
---
 docs/misra/rules.rst | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Julien Grall June 1, 2022, 5:19 p.m. UTC | #1
Hi Stefano,

On 01/06/2022 02:44, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xilinx.com>
> 
> Add Rule 5.1, with the additional note that the character limit for Xen
> is 40 characters.
> 
> The max length identifiers found by ECLAIR are:
> 
> __mitigate_spectre_bhb_clear_insn_start
> domain_pause_by_systemcontroller_nosync
> 
> Both of them are 40 characters long.
> 
> Explicitly mention that public headers might have longer identifiers.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,
diff mbox series

Patch

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 7d6a9fe063..6ccff07765 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -82,6 +82,13 @@  existing codebase are work-in-progress.
      - Line-splicing shall not be used in // comments
      -
 
+   * - `Rule 5.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_01_2.c>`_
+     - Required
+     - External identifiers shall be distinct
+     - The Xen characters limit for identifiers is 40. Public headers
+       (xen/include/public/) are allowed to retain longer identifiers
+       for backward compatibility.
+
    * - `Rule 6.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_06_02.c>`_
      - Required
      - Single-bit named bit fields shall not be of a signed type