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

[XEN PATCH 2/5] iommu: address violation of MISRA C Rule 5.5


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Fri, 4 Jul 2025 20:39:35 +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=LFEhnjI1bfoyDLK3xv+TPUZ1vpS2vxUiyW7XQCXI7eA=; b=eCkoNQyLE50ScpXcdZ+FpgXpyBAX2e9w/gsPxqvhvuFhH1HgZDhaQac4bszAMiaONMxur2S0n0igymIf1rF9+vKDrDpbNVVJ8xaR1U3Mg+48xNY4PYI6s+CesY20LnGQHVRxTPdfrNYUNBFrE6fETePZV9JZchnTpdJ2GHOs6ga88tCvJEFS7I3FnuOH9miZAAqIV1PBHdgAdvg3jKAjTlgINeJPLvJ+7Bp6FsskyGIfblv3d6WZQMOrB8ZiqKQ4VO8t8F9qA/9XC5AxkKBFd5MajS5xPLd4Qkbt3kmTYR2leAVY+feLJqsXBrRht5KQRXK66je/uKyEge3FHtwuKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xBjoLqraoelj018rEINNCjAUwK2j7eUSb1VFeUHkRAJArsdFiB/pmf9hVUMyV+HN0OjeOSlHu77sfPYZOYiClhY9goNUOCiFYlpg3Uv/qM3r0EnPkvBv/wk8i0KretRieistP5pcXg+b8D19UhXkoiimzVA3E9kMmICSVzWLgWxItFecxNf2jLTEMbqTEKCWLw/cI72x/3SUUd7UYeggv81E4tc4D6QVy385UgzvNJWzaYsQlQ605Z/QoPJn6eJhZRFF9s3lZ7MB5+UP3en9Sg+dQgMON/REGEtjPeJlbeYG3UzcjJxH232RVu+sI2VNgMKCi2kb2HxhTal4/gM+ig==
  • 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: Fri, 04 Jul 2025 20:39:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb7SPBz9lylza3OEK8worIo7OoNA==
  • Thread-topic: [XEN PATCH 2/5] 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/include/xen/iommu.h: non-compliant struct 'page_list_head'
xen/include/xen/mm.h: non-compliant macro 'page_list_head'
xen/drivers/passthrough/iommu.c: non-compliant macro 'iommu_quarantine'
xen/include/xen/iommu.h: non-compliant variable 'iommu_quarantine'

These external variables ('iommu_pt_cleanup_lock'
and 'iommu_pt_cleanup_list') are no longer used
in the codebase. Removing them eliminates dead
code and ensures compliance with coding standards.
Fixes: b5622eb627 (iommu: remove unused iommu_ops method and tasklet, 
2020-09-22)

The variable 'iommu_quarantine' makes sence to use
only if 'CONFIG_HAS_PCI=y', so place it inside '#ifdef'.

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

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index ebfada1d88..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
@@ -500,9 +502,6 @@ void iommu_dev_iotlb_flush_timeout(struct domain *d, struct 
pci_dev *pdev);
  */
 DECLARE_PER_CPU(bool, iommu_dont_flush_iotlb);
 
-extern struct spinlock iommu_pt_cleanup_lock;
-extern struct page_list_head iommu_pt_cleanup_list;
-
 bool arch_iommu_use_permitted(const struct domain *d);
 
 #ifdef CONFIG_X86
-- 
2.43.0



 


Rackspace

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