* [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
* Re: [FDT][PATCH] Fix padding options
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
0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2007-12-04 22:04 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Jon Loeliger
On Tue, Dec 04, 2007 at 10:27:52AM -0600, Kumar Gala wrote:
> commit 22e787ca2b1e49a9a0f3c43262564ab1038c5c3c broke the padding
> support. We were updating the fdt header after writing it.
Uh.. I can't find a commit with that SHA1. Which one are you
referring to?
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FDT][PATCH] Fix padding options
2007-12-04 22:04 ` David Gibson
@ 2007-12-04 22:18 ` Kumar Gala
0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2007-12-04 22:18 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev, Jon Loeliger
I guess it was really git commit
2b7dc8dce549ad72ad437b254bf756d7ba4c2a5a
Add an option to pad the blob that is generated
- k
On Dec 4, 2007, at 4:04 PM, David Gibson wrote:
> On Tue, Dec 04, 2007 at 10:27:52AM -0600, Kumar Gala wrote:
>> commit 22e787ca2b1e49a9a0f3c43262564ab1038c5c3c broke the padding
>> support. We were updating the fdt header after writing it.
>
> Uh.. I can't find a commit with that SHA1. Which one are you
> referring to?
>
> --
> David Gibson | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_
> _other_
> | _way_ _around_!
> http://www.ozlabs.org/~dgibson
^ permalink raw reply [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
* Re: [FDT][PATCH] Fix padding options
2007-12-04 23:36 Kumar Gala
@ 2007-12-05 14:47 ` Jon Loeliger
0 siblings, 0 replies; 5+ messages in thread
From: Jon Loeliger @ 2007-12-05 14:47 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
So, like, the other day Kumar Gala mumbled:
> "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>
Applied.
jdl
^ permalink raw reply [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).