From 35431ecb9db8c925a595f652dfbd1d2641bd2ff0 Mon Sep 17 00:00:00 2001 From: Federico Serafini Date: Tue, 12 Dec 2023 14:04:22 +0100 Subject: [PATCH] xen/arm: smmu: move phys_addr_t definition to linux-compat.h Both smmu and smmu-v3 (ported from Linux) define the typedef name "phys_addr_t": move the type definition to the common header linux-compat.h to address violations of MISRA C:2012 Rule 5.6 ("A typedef name shall be a unique identifier"). No functional change. Suggested-by: Jan Beulich Suggested-by: Julien Grall Signed-off-by: Federico Serafini Acked-by: Jan Beulich Reviewed-by: Julien Grall --- xen/drivers/passthrough/arm/smmu-v3.h | 1 - xen/drivers/passthrough/arm/smmu.c | 1 - xen/include/xen/linux-compat.h | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu-v3.h b/xen/drivers/passthrough/arm/smmu-v3.h index 05f6b1fb7e..f09048812c 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.h +++ b/xen/drivers/passthrough/arm/smmu-v3.h @@ -377,7 +377,6 @@ /* Linux compatibility functions. */ typedef paddr_t dma_addr_t; -typedef paddr_t phys_addr_t; typedef unsigned int gfp_t; /* Alias to Xen lock functions */ diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 11fc1d22ef..32e2ff279b 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -199,7 +199,6 @@ static inline int pci_for_each_dma_alias(struct pci_dev *pdev, /* Xen: misc */ #define PHYS_MASK_SHIFT PADDR_BITS -typedef paddr_t phys_addr_t; #define VA_BITS 0 /* Only used for configuring stage-1 input size */ diff --git a/xen/include/xen/linux-compat.h b/xen/include/xen/linux-compat.h index 8d06bb6dc9..62ba71485c 100644 --- a/xen/include/xen/linux-compat.h +++ b/xen/include/xen/linux-compat.h @@ -17,4 +17,6 @@ typedef int16_t __s16; typedef int32_t __s32; typedef int64_t __s64; +typedef paddr_t phys_addr_t; + #endif /* __XEN_LINUX_COMPAT_H__ */