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

[XEN v7 06/11] xen: dt: Replace u64 with uint64_t as the callback function parameters for dt_for_each_range()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Thu, 18 May 2023 15:39:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fc/6ksSNIY14+cMIRv0fMrHzTXfYwm3DIOoQYaSFZAM=; b=mmIwTPUwjh0down3t8bHqjdQQblEEBW29Qv65oYd67eza7VGyDqQxU2Oy6ynaZSDbwrNUnpeKRlJBtnIryTiSA1Wv3RJ+mEtO5P4LevGyX/cAl5Q49AQN6CYgXnAQVQHvMTTA7OfJV0h7IosWdb+oDKtjDrXR9qLAVf9sxkeSV3u9KB8ufcZ4/tuo4TIrC4iRjiUgLXeSyXWLbHdOlXhXrsO35pripi3T6Tzjk6CHZv+r0xcufJy0O/DeBiHqaArAisCR8iu/eYW7sTPyJ6ujPdRk9k7UhKNXsRJQqKtNMOEPrVHPG/2B6gYIvZM8S/UMjSW5MaPLjsssVfsAN1BzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aS+z61dIEOh9wHoYQV5HXZhDJBTlh4TPoLbW+9gdcSiLp3XAhVn/tBxddyrVUTKUk4yq1AT/ovHB07PoVgvS99vV47y8G2dE7XfGsIhT7sUrLEMOSx+AA/YhLt/XirD4t8e1qEKICwLqEP0nUj4+voZ3vjdR/jOxiR64NEJV89nmJlN4bV3Wd3XbBLUGRhKgLmhoB7X3vjQPvujpbkjElB68qQyQICCnqNtpCAAmZsHFSUZjT0XqfRA8p7VzAV/atuxZDMZbqK4D3jMXVE4Pl0nlAx0jht8jhsIucB9zqc9JrG+HiNbBmRo5T5llVni8iXn7rE0ZCztJ4/9BsQfEug==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, <rahul.singh@xxxxxxx>, <michal.orzel@xxxxxxx>, "Ayan Kumar Halder" <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Thu, 18 May 2023 14:41:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In the callback functions invoked by dt_for_each_range() ie handle_pci_range(),
map_range_to_domain(), 'u64' should be replaced with 'uint64_t' as the data type
for the parameters. The reason being Xen coding style mentions that u32/u64
should be avoided.

Also dt_for_each_range() invokes the callback functions with 'uint64_t'
arguments. Thus, is_bar_valid() needs to change the parameter types accordingly.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Changes from :-

v1-v5 - New patch introduced in v6.

v6 - 1. Merged "[XEN v6 08/12] xen: dt: Replace u64 with uint64_t as the 
callback"
and "[XEN v6 09/12] xen/arm: pci: Use 'uint64_t' as the datatype for the .."

2. Added R-b.

 xen/arch/arm/domain_build.c        | 4 ++--
 xen/arch/arm/include/asm/setup.h   | 2 +-
 xen/arch/arm/pci/pci-host-common.c | 2 +-
 xen/common/device_tree.c           | 4 ++--
 xen/include/xen/device_tree.h      | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index cb23f531a8..3f4558ade6 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1637,7 +1637,7 @@ out:
 }
 
 static int __init handle_pci_range(const struct dt_device_node *dev,
-                                   u64 addr, u64 len, void *data)
+                                   uint64_t addr, uint64_t len, void *data)
 {
     struct rangeset *mem_holes = data;
     paddr_t start, end;
@@ -2334,7 +2334,7 @@ static int __init map_dt_irq_to_domain(const struct 
dt_device_node *dev,
 }
 
 int __init map_range_to_domain(const struct dt_device_node *dev,
-                               u64 addr, u64 len, void *data)
+                               uint64_t addr, uint64_t len, void *data)
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 47ce565d87..fe17cb0a4a 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -166,7 +166,7 @@ u32 device_tree_get_u32(const void *fdt, int node,
                         const char *prop_name, u32 dflt);
 
 int map_range_to_domain(const struct dt_device_node *dev,
-                        u64 addr, u64 len, void *data);
+                        uint64_t addr, uint64_t len, void *data);
 
 extern DEFINE_BOOT_PAGE_TABLE(boot_pgtable);
 
diff --git a/xen/arch/arm/pci/pci-host-common.c 
b/xen/arch/arm/pci/pci-host-common.c
index 5dd62e8013..7cdfc89e52 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -381,7 +381,7 @@ int __init pci_host_bridge_mappings(struct domain *d)
  * right place for alignment check.
  */
 static int is_bar_valid(const struct dt_device_node *dev,
-                        paddr_t addr, paddr_t len, void *data)
+                        uint64_t addr, uint64_t len, void *data)
 {
     struct pdev_bar_check *bar_data = data;
     paddr_t s = bar_data->start;
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 20bc369367..8da1052911 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -994,7 +994,7 @@ int dt_device_get_paddr(const struct dt_device_node *dev, 
unsigned int index,
 
 int dt_for_each_range(const struct dt_device_node *dev,
                       int (*cb)(const struct dt_device_node *,
-                                u64 addr, u64 length,
+                                uint64_t addr, uint64_t length,
                                 void *),
                       void *data)
 {
@@ -1057,7 +1057,7 @@ int dt_for_each_range(const struct dt_device_node *dev,
 
     for ( ; rlen >= rone; rlen -= rone, ranges += rone )
     {
-        u64 a, s;
+        uint64_t a, s;
         int ret;
 
         memcpy(addr, ranges + na, 4 * pna);
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index d514c486a8..c2eada7489 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -681,7 +681,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
  */
 int dt_for_each_range(const struct dt_device_node *dev,
                       int (*cb)(const struct dt_device_node *,
-                                u64 addr, u64 length,
+                                uint64_t addr, uint64_t length,
                                 void *),
                       void *data);
 
-- 
2.17.1




 


Rackspace

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