[Crosstoolchain-logs] [device-tree-compiler] 82/357: libfdt: Use correct property format
Hector Oron
zumbi at moszumanska.debian.org
Thu Dec 8 17:05:52 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 07a12a08005f3b5cd9337900a6551e450c07b515
Author: David Gibson <dgibson at sneetch.(none)>
Date: Fri Feb 23 14:40:14 2007 +1100
libfdt: Use correct property format
Since its beginning, libfdt has used an incorrect definition of the
format for a property, putting the name offset before length, rather
than the other way around as described in booting-without-of.txt.
This corrects the error, making libfdt actually produce and use trees
which are compatible with the kernel and dtc.
Signed-of-by: David Gibson <david at gibson.dropbear.id.au>
---
fdt.c | 2 +-
fdt.h | 2 +-
tests/trees.S | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fdt.c b/fdt.c
index 45568b1..772da46 100644
--- a/fdt.c
+++ b/fdt.c
@@ -83,7 +83,7 @@ uint32_t _fdt_next_tag(const void *fdt, int offset, int *nextoffset)
return FDT_END;
break;
case FDT_PROP:
- lenp = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, sizeof(*lenp));
+ lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
if (! lenp)
return FDT_END;
/* skip name offset, length and value */
diff --git a/fdt.h b/fdt.h
index fff533e..4687a31 100644
--- a/fdt.h
+++ b/fdt.h
@@ -36,8 +36,8 @@ struct fdt_node_header {
struct fdt_property {
uint32_t tag;
- uint32_t nameoff;
uint32_t len;
+ uint32_t nameoff;
char data[0];
};
diff --git a/tests/trees.S b/tests/trees.S
index 397c151..6057668 100644
--- a/tests/trees.S
+++ b/tests/trees.S
@@ -39,8 +39,8 @@ tree: \
#define PROPHDR(tree, name, len) \
FDTLONG(FDT_PROP) ; \
- FDTLONG(tree##_##name - tree##_strings) ; \
- FDTLONG(len) ;
+ FDTLONG(len) ; \
+ FDTLONG(tree##_##name - tree##_strings) ;
#define PROP_INT(tree, name, val) \
PROPHDR(tree, name, 4) \
--
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