Hi,
in socppc's fdt init code there's a path that is always run but never
produces anything valid, as it's overridden directly after.
tree.strings_size is always set to fh_strings_size at the end. So in
reality that whole version block might run, but in the end is completely
useless. As no one has found that yet, I think it's safe to just get rid
of that whole block. I'd also be fine with keeping the block and just
removing that assignment at the end.
I have no hardware to verify it.
Patrick
diff --git sys/arch/socppc/socppc/fdt.c sys/arch/socppc/socppc/fdt.c
index 7423988..6f30a85 100644
--- sys/arch/socppc/socppc/fdt.c
+++ sys/arch/socppc/socppc/fdt.c
@@ -87,25 +87,6 @@ fdt_init(void *fdt)
tree.strings = (char *)fdt + tree.header->fh_strings_off;
tree.memory = (char *)fdt + tree.header->fh_reserve_off;
tree.version = version;
-
- if (version < 3) {
- if ((tree.strings < tree.tree) && (tree.tree < tree.memory))
- tree.strings_size = tree.tree - tree.strings;
- else if ((tree.strings < tree.memory) && (tree.memory <
- tree.tree))
- tree.strings_size = tree.memory - tree.strings;
- else if ((tree.strings < tree.tree) && (tree.memory <
- tree.strings))
- tree.strings_size = tree.tree - tree.strings;
- else if ((tree.strings < tree.memory) && (tree.tree <
- tree.strings))
- tree.strings_size = tree.memory - tree.strings;
- else
- tree.strings_size = tree.header->fh_size -
- (int)tree.strings;
- } else
- tree.strings_size = tree.header->fh_strings_size;
-
tree.strings_size = tree.header->fh_strings_size;
tree_inited = 1;