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

[XEN PATCH v2 1/3] iommu: address violation of MISRA C Rule 5.5


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Wed, 9 Jul 2025 21:38:16 +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=cJBgeEt4lGLc7WqUzZFKhOlmgPxJA6j+zHarfJZKliU=; b=jOeTOCSFhcL7+AtL5uOMC4M9XWgpRo8Ds8+7GH2P0beo6aIkWptnvehSI1WC9HiHecP4LA1BGwsRsml0FgaabCu39WFV/jHTqhCTnQy5HJsZsXeNm8AgjDEG1EVDvBDIfUcXeras/4dqgxaLadP7a1R97JiWVvdVz/KiHejnc21/h9c0Dy31lRiq5HTAOaJs3HMliiYxqDv0pAVQEB1x03xVlzUnHOg4GK3XoTaRKNtcnnWY+KiJLhb8ddc0j0COzsGMd5ptcjnzIozGmWK5Qga+Mga5oHrFqKYc0JBz+cYHZcWqB3vixHBtf4ZGizN2wcswlHeymIF2w6wIcLi53A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qp56G6l0+XlnLKxrOWPXcYIcdYg3CotWIJf5NRvo8sknNkO+YnPqIBjBBOUyEMnnNLGXqWHmPEpjj6Eaxy+gSemaEee91CD6UpH0lzwKZXdaFsYErlBPydG3Z2afMbfPWSus91VeQv2diZBmJYoGWui7wYAf0fvk2UwPWIxdXoOLpNOSGaXdb8nJzs3LxMo9M35IjpwMvQPJqs4FYuH/j9o/fZf5v0V5Gji3c5WgJgmEEvzjOzkhB1UMutOCnXzEpc86fJxdXAhmsF734r4hU/LpEuGqQtBawutjbpVsbgHWY32KGTrBZNuE1F2nacrCWwtDVwdWPldmNISbOR6TVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 09 Jul 2025 21:38:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb8RnHknh9PmNpckO7ne8U6W29yA==
  • Thread-topic: [XEN PATCH v2 1/3] iommu: address violation of MISRA C Rule 5.5

Address a violation of MISRA C:2012 Rule 5.5:
"Identifiers shall be distinct from macro names".

Reports for service MC3A2.R5.5:
xen/drivers/passthrough/iommu.c: non-compliant macro 'iommu_quarantine'
xen/include/xen/iommu.h: non-compliant variable 'iommu_quarantine'

There is a clash between function name and macro.
Add an 'extern' declaration for 'iommu_quarantine'
under the same preprocessor condition (#ifdef CONFIG_HAS_PCI).
This ensures that the declaration is consistent
and only exposed when CONFIG_HAS_PCI is defined.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 xen/include/xen/iommu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3205e49990..57f338e2a0 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -53,7 +53,9 @@ static inline bool dfn_eq(dfn_t x, dfn_t y)
 extern bool iommu_enable, iommu_enabled;
 extern bool force_iommu, iommu_verbose;
 /* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */
+#ifdef CONFIG_HAS_PCI
 extern uint8_t iommu_quarantine;
+#endif /* CONFIG_HAS_PCI */
 #else
 #define iommu_enabled false
 #endif
-- 
2.43.0



 


Rackspace

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