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

[PATCH 02/10] dt: Add cf_check to device-tree.c function pointers


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Tue, 22 Jul 2025 13:59:42 +0200
  • 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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ZHHAxnoI2fqSEb/wARAT9NpQUxHrbRq9p94gqPuSuho=; b=H4cDETwWDFmPEy+MFYdrXGoH1aYQD4f3O32VefRPmHG33XTOoE4x0LdGo2/6+Xkn2nmzZORhyMVdXnxOSVz6nxHkgzzl5OlMO2ywdOTeAYNST8iUE0tq7QWpRDBK4YGWZScHSh9tQM1mOsE3Lks184wd0ZLdqpckxl0dA73thKT23/9b2kxm9HZPcGhrWhX3nzKPheuluLG93X4lv/HZmNtxIf7SXyAl+wgekYJA4I+rSkTWSOZZt0smTXRf9LHwKvbSpmwU6Cy+YYQam2s7sL7JTvwCQkrv5UJXBgfFZjdlDz981kNm11ikmXG6e4X9ivxTdlZMrF/asEGHobLaww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t7r0vjUGfRlgoH4+o+vV4XxpEuMrwycI/bbJDw6x13bz0RHBfP8otriR4bClPqRFe8vAtfjck8hjaYc8TObMr6bKflR77o/260BvpSt15f05hgptFsHqNjztWBJxV5gPfn6Oz3TM9zdsUxK+rJ9fUeMZtqdLUTaHqAfErXCPUIZmBQ34CO+tT3PP3sxnMdxcooipbbbyDYmyOuaFMnJPEOsCfd1UQVxmcl0NvPRxBxqYdxR7apml+rfqdXDi94hFfXQ24JSlXkpvP7/aTYUTROqt77IEzRv2D4oakjnHtFaQSEcjnlqoPECri6EQDptvt8IK2mGiQY1YXJlxbvM70g==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, "Edgar E . Iglesias" <edgar.iglesias@xxxxxxx>
  • Delivery-date: Tue, 22 Jul 2025 12:00:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In preparation for it to be usable on x86 with IBT, tag targets of
function pointers with cf_check

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxx>
---
 xen/common/device-tree/device-tree.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/xen/common/device-tree/device-tree.c 
b/xen/common/device-tree/device-tree.c
index 84daa3f0ed..0b5375f151 100644
--- a/xen/common/device-tree/device-tree.c
+++ b/xen/common/device-tree/device-tree.c
@@ -538,7 +538,7 @@ int dt_child_n_size_cells(const struct dt_device_node 
*parent)
 /*
  * Default translator (generic bus)
  */
-static bool dt_bus_default_match(const struct dt_device_node *node)
+static bool cf_check dt_bus_default_match(const struct dt_device_node *node)
 {
     /* Root node doesn't have "ranges" property */
     if ( node->parent == NULL )
@@ -550,8 +550,8 @@ static bool dt_bus_default_match(const struct 
dt_device_node *node)
     return (dt_get_property(node, "ranges", NULL) != NULL);
 }
 
-static void dt_bus_default_count_cells(const struct dt_device_node *dev,
-                                int *addrc, int *sizec)
+static void cf_check dt_bus_default_count_cells(
+    const struct dt_device_node *dev, int *addrc, int *sizec)
 {
     if ( addrc )
         *addrc = dt_n_addr_cells(dev);
@@ -559,8 +559,8 @@ static void dt_bus_default_count_cells(const struct 
dt_device_node *dev,
         *sizec = dt_n_size_cells(dev);
 }
 
-static u64 dt_bus_default_map(__be32 *addr, const __be32 *range,
-                              int na, int ns, int pna)
+static u64 cf_check dt_bus_default_map(__be32 *addr, const __be32 *range,
+                                       int na, int ns, int pna)
 {
     u64 cp, s, da;
 
@@ -585,7 +585,7 @@ static u64 dt_bus_default_map(__be32 *addr, const __be32 
*range,
     return da - cp;
 }
 
-static int dt_bus_default_translate(__be32 *addr, u64 offset, int na)
+static int cf_check dt_bus_default_translate(__be32 *addr, u64 offset, int na)
 {
     u64 a = dt_read_number(addr, na);
 
@@ -597,7 +597,7 @@ static int dt_bus_default_translate(__be32 *addr, u64 
offset, int na)
 
     return 0;
 }
-static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+static unsigned int cf_check dt_bus_default_get_flags(const __be32 *addr)
 {
     return IORESOURCE_MEM;
 }
@@ -616,7 +616,7 @@ static bool dt_node_is_pci(const struct dt_device_node *np)
     return is_pci;
 }
 
-static bool dt_bus_pci_match(const struct dt_device_node *np)
+static bool cf_check dt_bus_pci_match(const struct dt_device_node *np)
 {
     /*
      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
@@ -630,8 +630,8 @@ static bool dt_bus_pci_match(const struct dt_device_node 
*np)
         dt_node_is_pci(np);
 }
 
-static void dt_bus_pci_count_cells(const struct dt_device_node *np,
-                                  int *addrc, int *sizec)
+static void cf_check dt_bus_pci_count_cells(const struct dt_device_node *np,
+                                                                   int *addrc, 
int *sizec)
 {
     if (addrc)
         *addrc = 3;
@@ -639,7 +639,7 @@ static void dt_bus_pci_count_cells(const struct 
dt_device_node *np,
         *sizec = 2;
 }
 
-static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
+static unsigned int cf_check dt_bus_pci_get_flags(const __be32 *addr)
 {
     unsigned int flags = 0;
     u32 w = be32_to_cpu(*addr);
@@ -658,8 +658,8 @@ static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
     return flags;
 }
 
-static u64 dt_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
-               int pna)
+static u64 cf_check dt_bus_pci_map(__be32 *addr, const __be32 *range,
+                                   int na, int ns, int pna)
 {
     u64 cp, s, da;
     unsigned int af, rf;
@@ -685,7 +685,7 @@ static u64 dt_bus_pci_map(__be32 *addr, const __be32 
*range, int na, int ns,
     return da - cp;
 }
 
-static int dt_bus_pci_translate(__be32 *addr, u64 offset, int na)
+static int cf_check dt_bus_pci_translate(__be32 *addr, u64 offset, int na)
 {
     return dt_bus_default_translate(addr + 1, offset, na - 1);
 }
-- 
2.43.0




 


Rackspace

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