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_prokopch...@epam.com> --- 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