From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
Samuel Dionne-Riel <samuel@dionne-riel.com>
Subject: [PATCH 1/2] fdtgrep: Correct alignment of struct section
Date: Wed, 8 Dec 2021 09:55:34 -0700 [thread overview]
Message-ID: <20211208165535.3924959-1-sjg@chromium.org> (raw)
When outputting a devicetree we should not align the struct section to a
16-byte boundary. The normal position is fine, which is 8-byte aligned.
This avoids leaving adding 8 extra zero bytes in the output tree in the
case where the reserved section is empty (i.e has 16 zero bytes).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
tools/fdtgrep.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c
index db512465db1..641d6a2e3e0 100644
--- a/tools/fdtgrep.c
+++ b/tools/fdtgrep.c
@@ -438,8 +438,7 @@ static int dump_fdt_regions(struct display_info *disp, const void *blob,
fdt = (struct fdt_header *)out;
memset(fdt, '\0', sizeof(*fdt));
fdt_set_magic(fdt, FDT_MAGIC);
- struct_start = FDT_ALIGN(sizeof(struct fdt_header),
- sizeof(struct fdt_reserve_entry));
+ struct_start = sizeof(struct fdt_header);
fdt_set_off_mem_rsvmap(fdt, struct_start);
fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
--
2.34.1.400.ga245620fadb-goog
next reply other threads:[~2021-12-08 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 16:55 Simon Glass [this message]
2021-12-08 16:55 ` [PATCH 2/2] fdtgrep: Handle an empty output tree Simon Glass
2021-12-17 16:46 ` Simon Glass
2021-12-17 16:46 ` [PATCH 1/2] fdtgrep: Correct alignment of struct section Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211208165535.3924959-1-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=samuel@dionne-riel.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).