Skip to contentSkip to conversation

libfdt: Move the working_fdt pointer to cmd_fdt.c

PATCH New Jerry Van Baren 2 participants 2 messages Jun 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdt: Move the working_fdt pointer to cmd_fdt.c

The working_fdt pointer was declared in common/fdt_support.c but was not used there. Move it to common/cmd_fdt.c where it is used (it is also used in lib_ppc/bootm.c).

---

Hi Kim,

I've applied your patch "fdt: unshadow global working fdt variable". As a feeble attempt to redeem myself, I added a patch to move working_fdt to cmd_fdt.c... it isn't used (any longer) in fdt_support.c.

I started to hack bootm.c (if we moved the reference to working_fdt out of boot_relocate_fdt() or move that function, we could make working_fdt static), but it got too complex so I backed out of that change for now.

Best regards,
gvb

 common/cmd_fdt.c     |    5 +++++
 common/fdt_support.c |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_fdt.c +5 -0
index 5c3a0bb..97b9dd7 100644
@@ -46,6 +46,11 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len);
 static int fdt_print(const char *pathp, char *prop, int depth);
 
 /*
+ * The working_fdt points to our working flattened device tree.
+ */
+struct fdt_header *working_fdt;
+
+/*
  * Flattened Device Tree command, see the help for parameter definitions.
  */
 int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
common/fdt_support.c +0 -5
index e8aa3e9..e58b294 100644
@@ -35,11 +35,6 @@
  */
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * fdt points to our working device tree.
- */
-struct fdt_header *working_fdt;
-
 
 /**
  * fdt_find_and_setprop: Find a node and set it's property
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/1 libfdt: Move the working_fdt pointer to cmd_fdt.c

Quoted 3 lines · On Tue, 10 Jun 2008 22:36:07 -0400 Jerry Van Baren <[email protected]> wrote:

I've applied your patch "fdt: unshadow global working fdt variable". As a feeble attempt to redeem myself, I added a patch to move working_fdt to cmd_fdt.c... it isn't used (any longer) in fdt_support.c.

sounds good

Quoted 3 lines

I started to hack bootm.c (if we moved the reference to working_fdt out of boot_relocate_fdt() or move that function, we could make working_fdt static), but it got too complex so I backed out of that change for now.

:)

I gave a shot at switching all MPC8[356]xx to MPC8[356]XX but the 100k limit, stepping into 51xx space, and probably horrible timing (due to the many unapplied patches out there) prevented me from doing so.

thanks,

Kim