|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 2/3] misra: deviate MISRA C Rule 5.5 for request_irq()
MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
names".
Update ECLAIR configuration to deviate identifier and macro name
clashes by specifying the macros that should be ignored.
This includes request_irq(), where the Xen function takes the IRQ
flags before the handler argument, while the macro adapts ARM SMMU
driver calls by reordering the arguments.
Update deviations.rst and rules.rst accordingly.
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
docs/misra/deviations.rst | 7 +++++++
docs/misra/rules.rst | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 400413f8f5..d62f339103 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -137,6 +137,10 @@ These macros address differences in argument count during
compile-time, effectiv
-config=MC3A2.R5.5,ignored_macros+="name(hypfs_alloc_dyndata)&&loc(file(^xen/include/xen/hypfs\\.h$))"
-doc_end
+-doc_begin="Clash between request_irq() function and macro name in
xen/drivers/passthrough/arm/smmu.c is deliberate."
+-config=MC3A2.R5.5,ignored_macros+="name(request_irq)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"
+-doc_end
+
-doc_begin="The type \"ret_t\" is deliberately defined multiple times,
depending on the guest."
-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 6bcc2adf95..1524895dd2 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -185,6 +185,13 @@ Deviations related to MISRA C:2012 Rules:
macro before defining the real function, so the name clash is
controlled.
- ECLAIR has been configured to ignore this macro.
+ * - R5.5
+ - Clash between the request_irq() function and macro name in the file
+ xen/drivers/passthrough/arm/smmu.c is deliberate. The function uses the
+ argument order, while the macro is a compatibility wrapper for the ARM
+ SMMU driver that adapts calls by reordering the handler and flags
arguments.
+ - ECLAIR has been configured to ignore this macro.
+
* - R5.6
- The type ret_t is deliberately defined multiple times depending on the
type of guest to service.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index a59cf1782e..497e393d4f 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -227,6 +227,11 @@ maintainers if you want to suggest a change.
file xen/include/xen/hypfs.h is allowed because the macro is a typed
convenience wrapper around the size-based allocation function.
+ Clash between request_irq() function and macro names in the file
+ xen/drivers/passthrough/arm/smmu.c is allowed because the macro is a
+ local compatibility wrapper that adapts ARM SMMU driver's request_irq()
+ argument order.
+
* - `Rule 5.6
<https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_
- Required
- A typedef name shall be a unique identifier
--
2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |