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

[XEN 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 <jbeulich@xxxxxxxx>
Suggested-by: Julien Grall <julien@xxxxxxx>
Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
---
 xen/drivers/passthrough/arm/smmu-v3.h | 1 -
 xen/drivers/passthrough/arm/smmu.c    | 1 -
 xen/include/xen/linux-compat.h        | 1 +
 3 files changed, 1 insertion(+), 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..987ac7d8db 100644
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -16,5 +16,6 @@ typedef uint8_t __u8;
 typedef int16_t __s16;
 typedef int32_t __s32;
 typedef int64_t __s64;
+typedef paddr_t phys_addr_t;
 
 #endif /* __XEN_LINUX_COMPAT_H__ */
-- 
2.34.1




 


Rackspace

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