[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for 'request_irq()'


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Sun, 12 Jul 2026 14:04:46 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0pZ1BxC6Bi6p0st6xJAQ+Jaqgwg9JBDmWidIIVcm3DY=; b=viqg/sZvTmdp3jX+qkR2dS0BXbIjXWfCSH2E2Ptpxfw7gZB+P4q5RhuRJoRE56MAWz8wuA8OJ8sz6UNZQ/qW4PEBbcVXCPrW6/EVNGnhyv+CKZHNXLMy+BgQvHaUmX4cX08JmIUmEv6aw2Go+jogfV/6CeV9Yj0aYTyIKwTG5ycb8PM3pKyJK3uedPeoJB6feSl3IOP+Pghm3XEudf9uM6yW53ZNmPvaucbSIMDAOPVPqPrV5ZWjOvG/vXzZsDBIgIZOpOktj3wEq00x1frAdqXrgcDz91z5N6UOts3b7iligbPIR8qg5PqHTF7ggpAqSPRj5VakFFFQzMju4rCa4A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XIXYm8nLETFalaod7ahYh9tne8QIUChUnJIVG6wlGhZd4lR6+DU5esvhk01y+Zsa8Yc8DZeT2z/x7OfV8xKB9ciqZSXvd5R6Sni5ZFjt9e1Mk6ckB6fy5e0qGZnrqnvseufpgmhbhG4Uvauo4JOEQ1NCO6C+VITPBj4d/L80feH3xHKn48vXv/Ml/IjmhOIBSka3A6b3Tc8sxOYSPgL9NE2g/1XYAgu250tyKC/wGiM0sZRMCjggxy3AWEC6QkLXQ0grMEb+wz/Ewwdw9zD7ori8GuYhjGyqTil+ufS95kpoSxVB7pH7uCJg6EqJKBuz+h9NLhcCASDdM1oAHHzjAw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sun, 12 Jul 2026 14:05:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdEgdlLv7TI7G6yke6ZZX0wGJbmw==
  • Thread-topic: [PATCH v2 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                             | 4 ++++
 3 files changed, 15 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 7e743f7c5e..f7ffd78a36 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -136,6 +136,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 ab80f01195..3eb9912c45 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -185,6 +185,13 @@ Deviations related to MISRA C:2012 Rules:
        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 is deliberate.
+       The function uses the Xen 'request_irq()' 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 4f7b7fc848..40aff97a07 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -226,6 +226,10 @@ maintainers if you want to suggest a change.
        because the macro is a typed convenience wrapper around the size-based
        allocation function.
 
+       Clash between request_irq() function and macro names is allowed because
+       the macro is a local compatibility wrapper that adapts ARM SMMU driver
+       call to Xen'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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.