Skip to contentSkip to conversation

LIBFDT: bogus definition of fdt in libfdt_env.h

U-Boot-Users Wolfgang Grandegger 2 participants 2 messages Apr 25, 2007

lore
Share & tools
lore
#0 lore raw

Hi Jerry,

in libfdt_env.h there is fdt defined as:

struct fdt_header *fdt; /* Pointer to the working fdt */

I think it should be declared "extern", because the file is included by more than one file. Or the declaration should be moved to cmd_fdt.c, because it's the only file actually using it.

Wolfgang.

#1 lore raw
Quoted 11 lines · Wolfgang Grandegger

Hi Jerry,

in libfdt_env.h there is fdt defined as:

struct fdt_header *fdt; /* Pointer to the working fdt */

I think it should be declared "extern", because the file is included by more than one file. Or the declaration should be moved to cmd_fdt.c, because it's the only file actually using it.

Wolfgang.

Hi Wolfgang G,

Yes, that is not declared properly. IIRC, I split the fdt_support.c out of cmd_fdt.c and moved the declaration into the .h file because I thought I would need it in more places (cmd_bootm.c, IIRC). The move was done poorly.

I'll add figuring out the proper location and declaration to the cleanup list. It probably should move (as a static) back into cmd_fdt.c until it is actually needed elsewhere.

Thanks,
gvb