The rule headline states: "A typedef name shall be a unique identifier".

in x86/mm/shadow/multi.c the typedef names for `guest_va_t` and `guest_pa_t`
are deliberately reused multiple times due to the file being included with
different GUEST_PAGING_LEVELS. As a result, a deviation for the rule is
introduced.

No functional change.

Signed-off-by: Nicola Vetrini <[email protected]>
---
CI pipeline: 
https://gitlab.com/xen-project/people/bugseng/xen/-/pipelines/2216437709
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 docs/misra/deviations.rst                        | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 219ba6993b90..86e782da3f12 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -143,6 +143,11 @@ number of guest paging levels."
 
-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/include/asm/guest_pt\\.h$)))&&any_area(any_loc(text(^.*(guest_intpte_t|guest_l[12]e_t).*$)))"}
 -doc_end
 
+-doc_begin="On X86 shadow paging code, the types \"guest_(va|pa)_t\" are 
deliberately
+defined multiple times, depending on the number of guest paging levels."
+-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/mm/shadow/multi\\.c$)))&&any_area(any_loc(text(^typedef.*guest_(va|pa)_t.*$)))"}
+-doc_end
+
 -doc_begin="The following files are imported from the gnu-efi package."
 -file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
 -file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b3431ef24e26..7f877142109d 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -187,6 +187,8 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR. Such types are:
          - guest_intpte_t
          - guest_l[12]e_t
+         - guest_va_t
+         - guest_pa_t
 
    * - R5.6
      - Some files are not subject to respect MISRA rules at
-- 
2.43.0


Reply via email to