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

[XEN][RFC PATCH v2 04/12] libfdt: Add fdt_ prefix to overlay_get_target()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • Date: Mon, 8 Nov 2021 23:02:19 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.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=0Fql05hs8YXgjepE7Xhz/cxP9a1+eoyB0oUmynBhbxw=; b=YPBnihvDhnOIbwb5E9kVJtYoe6m0Iw2q8bFCVn1c0fJb+ZB+Zjn1cno9wZPun1CBTPB0IrJ3gSpBlEN0Jtm/LtWS/ADqBQAm+hgZXudFqMZlKBFPcnzZsN45mSCKcxReqkQW/gqfOBPlW4EjyKrQF+f7unjcnnYU3hjnROCFDvFIoRc8tgGkLUzobKsHd1C/7Mcswb2FIoQGfG5Z7BLIXfHKjsGJcEtRKC42nxV1N7YgfTC9dFNm2yazxq08Mf6TOX1ndSl0hEVKeYkLSZKHrGuoQm2hxzlg3ncy+J2f2VPaA3dIoPkZBgEJZOrM4cWHl6OeTshyFhQmF550JzgoMA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCweG3OeKbLm9pcVQWFFHmJcUZ0nghsurtf4L/I02bztruGwX8hqQ8abDpBXSQF9D7Ajt4mkwg0zQHM34/+ItWl8kdl6KX0K3exeUNk5kO/OCA6OpZkYv83EhgHHihtzEsEVmpjKhXJ0GksU0VMB5+X1TFewWeuAjWjyrAga7qW/ZKFeJHkHAycaHFxPaokqgOaJsrdr/slRF0AOz2f3SAIPP8StiKWU4efaBmSTlAC5/n3dxA35nOGYd2gmuC0pZkWxlaLGj3vJ4VKncsX26soXrjBoyD+QsaCiC+2DKUVslw3i1exLgadMfy6aXuLr5sdbYotW1f5JkHewj9zM2g==
  • Cc: <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <bertrand.marquis@xxxxxxx>, <volodymyr_babchuk@xxxxxxxx>, Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • Delivery-date: Tue, 09 Nov 2021 07:03:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add fdt_ prefix to overlay_get_target() and remove static type. This is done to
get the target path for all the overlay nodes. This is useful to find which
nodes are to be added/removed in dt_host.

Also, sending this patch to dtc mailing list to avoid the divergence.

Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
---
 xen/common/libfdt/fdt_overlay.c | 12 ++++++------
 xen/include/xen/libfdt/libfdt.h |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/common/libfdt/fdt_overlay.c b/xen/common/libfdt/fdt_overlay.c
index 7b95e2b..194f51b 100644
--- a/xen/common/libfdt/fdt_overlay.c
+++ b/xen/common/libfdt/fdt_overlay.c
@@ -42,13 +42,13 @@ static uint32_t overlay_get_target_phandle(const void 
*fdto, int fragment)
 }
 
 /**
- * overlay_get_target - retrieves the offset of a fragment's target
+ * fdt_overlay_get_target - retrieves the offset of a fragment's target
  * @fdt: Base device tree blob
  * @fdto: Device tree overlay blob
  * @fragment: node offset of the fragment in the overlay
  * @pathp: pointer which receives the path of the target (or NULL)
  *
- * overlay_get_target() retrieves the target offset in the base
+ * fdt_overlay_get_target() retrieves the target offset in the base
  * device tree of a fragment, no matter how the actual targeting is
  * done (through a phandle or a path)
  *
@@ -56,7 +56,7 @@ static uint32_t overlay_get_target_phandle(const void *fdto, 
int fragment)
  *      the targeted node offset in the base device tree
  *      Negative error code on error
  */
-static int overlay_get_target(const void *fdt, const void *fdto,
+int fdt_overlay_get_target(const void *fdt, const void *fdto,
                              int fragment, char const **pathp)
 {
        uint32_t phandle;
@@ -638,7 +638,7 @@ static int overlay_merge(void *fdt, void *fdto)
                if (overlay < 0)
                        return overlay;
 
-               target = overlay_get_target(fdt, fdto, fragment, NULL);
+               target = fdt_overlay_get_target(fdt, fdto, fragment, NULL);
                if (target < 0)
                        return target;
 
@@ -781,7 +781,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
                        return -FDT_ERR_BADOVERLAY;
 
                /* get the target of the fragment */
-               ret = overlay_get_target(fdt, fdto, fragment, &target_path);
+               ret = fdt_overlay_get_target(fdt, fdto, fragment, &target_path);
                if (ret < 0)
                        return ret;
                target = ret;
@@ -803,7 +803,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
 
                if (!target_path) {
                        /* again in case setprop_placeholder changed it */
-                       ret = overlay_get_target(fdt, fdto, fragment, 
&target_path);
+                       ret = fdt_overlay_get_target(fdt, fdto, fragment, 
&target_path);
                        if (ret < 0)
                                return ret;
                        target = ret;
diff --git a/xen/include/xen/libfdt/libfdt.h b/xen/include/xen/libfdt/libfdt.h
index c71689e..1f549d0 100644
--- a/xen/include/xen/libfdt/libfdt.h
+++ b/xen/include/xen/libfdt/libfdt.h
@@ -2115,6 +2115,9 @@ int fdt_overlay_apply(void *fdt, void *fdto);
 
 const char *fdt_strerror(int errval);
 
+int fdt_overlay_get_target(const void *fdt, const void *fdto, int fragment,
+                           char const **pathp);
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.7.4




 


Rackspace

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