linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [FDT][PATCH] Fix padding options
@ 2007-12-04 16:27 Kumar Gala
  2007-12-04 22:04 ` David Gibson
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2007-12-04 16:27 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

commit 22e787ca2b1e49a9a0f3c43262564ab1038c5c3c broke the padding
support.  We were updating the fdt header after writing it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 flattree.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/flattree.c b/flattree.c
index c860b63..eb9c82c 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);

-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [FDT][PATCH] Fix padding options
@ 2007-12-04 23:36 Kumar Gala
  2007-12-05 14:47 ` Jon Loeliger
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2007-12-04 23:36 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

"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@kernel.crashing.org>
---

Better commit message for this, since my commit ID is different.

 flattree.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/flattree.c b/flattree.c
index c860b63..eb9c82c 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);

-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-05 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04 16:27 [FDT][PATCH] Fix padding options Kumar Gala
2007-12-04 22:04 ` David Gibson
2007-12-04 22:18   ` Kumar Gala
  -- strict thread matches above, loose matches on Subject: below --
2007-12-04 23:36 Kumar Gala
2007-12-05 14:47 ` Jon Loeliger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).