From patchwork Mon Dec 11 14:54:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13487361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E38AEC4167B for ; Mon, 11 Dec 2023 14:55:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.652277.1018041 (Exim 4.92) (envelope-from ) id 1rChgY-0007uQ-3n; Mon, 11 Dec 2023 14:55:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 652277.1018041; Mon, 11 Dec 2023 14:55:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rChgY-0007uH-0c; Mon, 11 Dec 2023 14:55:06 +0000 Received: by outflank-mailman (input) for mailman id 652277; Mon, 11 Dec 2023 14:55:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rChgX-0007Ua-2t for xen-devel@lists.xenproject.org; Mon, 11 Dec 2023 14:55:05 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 43dfeb48-9835-11ee-9b0f-b553b5be7939; Mon, 11 Dec 2023 15:55:03 +0100 (CET) Received: from Dell.bugseng.com.homenet.telecomitalia.it (host-80-116-181-249.retail.telecomitalia.it [80.116.181.249]) by support.bugseng.com (Postfix) with ESMTPSA id D82494EE073E; Mon, 11 Dec 2023 15:55:02 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 43dfeb48-9835-11ee-9b0f-b553b5be7939 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Rahul Singh Subject: [XEN PATCH] xen/arm: smmu: move phys_addr_t definition to linux-compat.h Date: Mon, 11 Dec 2023 15:54:56 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 | 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__ */