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

[PATCH 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: Mon, 25 May 2026 12:05:10 +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=EBJqopGr6g4Rs9QOkGhc7LSDyZACBgo/wZojZWVMwSw=; b=M4XQnBbQwy4RowH7Nl0uu0xwnS8dWtuIBnLgd62TwsJb3L2n+uo/or/v85hxJ7fgKPb9Raq9UmecjRtK4eS0rbs+QyGtxV3iNcQ8aB4yN/yE4kmeclsSeT6fNt3PAtFQgCsFyW+90WDaFjjwrDY59f3g6MA+OGAcA1864eyaJuOtbvYRUvgnA6Cqa3zCYFv/29e1BtVowebhg6hL1YM/WEbRTPehSN2IE/NRAeOU18uFq5XyCPb80mNJHa6g8QT6U6LPx+oeSbsDQXvJd7X0GSazcTrKGge0EQEOFGPVz+0g2oqQFvqbjnDpPBwj4Xqj+yONdIxtUJsOkOE0ia6jnw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XSyYHwcdGkp/piFroI8HCrDIxrRMatBzGMiR1AfMB+pgs1+x8vNVdCLnQG+iW2IGSyhyP62rdMgYbj2zV8SzBH2Xmq6IyOz8h8IvAU7uu8OkoUPPgSzd8SCKWx8UpKwSKae+sc1bmR50BINjoTXCzcI4IkQTZ7YMTQE6MCf4EHhCUuvENt9OuEk4EXghva9Oivxi0/q88wnvDCd0faUZ0JgnAtlAdCAboArfXRuw6HbNQceXfg5oaT+lZnXDgWTZDPHJgUqKmMvFAjbdKRHbNz6bvp5Ekzb0icgwrgdPlQIkIYDRAV+to9TIqJKsnTbI3l3CVzzX2dOSuvJia3k/3Q==
  • 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: Mon, 25 May 2026 12:05:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHc7D68tJeu+7CD8Eibunvyp3IKiQ==
  • Thread-topic: [PATCH 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 intentional 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 | 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.ecl
index 13a34b7703..7aa64796ba 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -138,6 +138,12 @@ hypfs nodes to allocate per-request traversal data with 
the correct size and ret
 
-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.
+The function uses the Xen 'request_irq()' argument order, while the macro is a 
compatibility wrapper that adapts
+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="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 f5b4ce9315..01f141b73f 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 intentional.
+       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 c0237725a9..097c20432e 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®.