[Crosstoolchain-logs] [device-tree-compiler] 213/357: Fix padding options

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.3.x
in repository device-tree-compiler.

commit 80c72a81cffdfde0965853d1ea834352b3e91f89
Author: Kumar Gala <galak at kernel.crashing.org>
Date:   Tue Dec 4 17:36:08 2007 -0600

    Fix padding options
    
    "Add an option to pad the blob that is generated" broke the padding
    support.  We were updating the fdt header after writing it.
    
    Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---
 flattree.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/flattree.c b/flattree.c
index 35b11b1..a7cfb84 100644
--- a/flattree.c
+++ b/flattree.c
@@ -399,6 +399,12 @@ void dt_to_blob(FILE *f, struct boot_info *bi, int version,
 	if (padsize > 0)
 		padlen = padsize;
 
+	if (padlen > 0) {
+		int tsize = be32_to_cpu(fdt.totalsize);
+		tsize += padlen;
+		fdt.totalsize = cpu_to_be32(tsize);
+	}
+
 	/*
 	 * Assemble the blob: start with the header, add with alignment
 	 * the reserve buffer, add the reserve map terminating zeroes,
@@ -414,12 +420,8 @@ void dt_to_blob(FILE *f, struct boot_info *bi, int version,
 	/*
 	 * If the user asked for more space than is used, pad out the blob.
 	 */
-	if (padlen > 0) {
-		int tsize = be32_to_cpu(fdt.totalsize);
-		tsize += padlen;
+	if (padlen > 0)
 		blob = data_append_zeroes(blob, padlen);
-		fdt.totalsize = cpu_to_be32(tsize);
-	}
 
 	fwrite(blob.val, blob.len, 1, f);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list