[PATCH 08/29] libfdt: Fix the Python pack() function

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



This currently fails to reduce the device-tree bytearray size. Fix this.

This stands in for a pending upstream change.

Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>
---

 scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
index 6774b93b2cb..5b38e63b267 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -442,7 +442,11 @@ class Fdt:
         Raises:
             FdtException if any error occurs
         """
-        return check_err(fdt_pack(self._fdt), quiet)
+        err = check_err(fdt_pack(self._fdt), quiet)
+        if err:
+            return err
+        del self._fdt[self.totalsize():]
+        return err
 
     def getprop(self, nodeoffset, prop_name, quiet=()):
         """Get a property from a node
-- 
2.17.1.1185.g55be947832-goog

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux