|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 3/3] misra: deviate MISRA C Rule 5.5 for ARM SMMU fault handlers
On 2026-05-25 14:05, Dmytro Prokopchuk1 wrote: MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro names". Update ECLAIR configuration to deviate intentional identifier and macro name clashes by specifying the macros that should be ignored. This includes 'arm_smmu_global_fault' and 'arm_smmu_context_fault', where the original ARM SMMU handler returns irqreturn_t, while the same-named macro redirects later uses to a Xen wrapper with the void interrupt-handler signature expected by Xen 'request_irq()'. Update deviations.rst and rules.rst accordingly. Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx> --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ docs/misra/deviations.rst | 7 +++++++ docs/misra/rules.rst | 4 ++++ 3 files changed, 17 insertions(+)diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.eclindex 7aa64796ba..419a23ce8e 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl@@ -144,6 +144,12 @@ ARM SMMU driver calls by reordering the handler and flags arguments." -config=MC3A2.R5.5,ignored_macros+="name(request_irq)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"-doc_end+-doc_begin="Clashes between ARM SMMU fault handler functions and macro names in 'xen/drivers/passthrough/arm/smmu.c' are deliberate. +The original ARM SMMU handler returns irqreturn_t, while the macro redirects later uses to a Xen wrapper with the+void interrupt-handler signature expected by Xen 'request_irq()'." +-config=MC3A2.R5.5,ignored_macros+="name(arm_smmu_global_fault||arm_smmu_context_fault)&&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.*$)))"} Seeing the growing number of exceptions for R5.5 and 5.6 for one reason or another in deviations.ecl, I wonder whether a more structured approach to the configuration would be better (e.g., a JSON file that is then processed just before the build to produce an ECL file fragment evaluated in the the right place). The change itself is fine, but I think this would tidy up a bit the file from these targeted exceptions. -- Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |