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.
Put the '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@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Dmytro Prokopchuk authored and Jan Beulich committed 2025-07-10 13:42:10 +02:00
1 parent 321de728d2
commit b2d78fab9f
1 file changed
+2
+2
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.