[PATCH v3] ARM: rpi: parse useful data from vc fdt

Sascha Hauer sha at pengutronix.de
Fri Jun 17 02:33:08 PDT 2022


On Fri, Jun 17, 2022 at 10:55:25AM +0200, Ahmad Fatoum wrote:
> Hi,
> 
> On 17.06.22 09:08, Ahmad Fatoum wrote:
> >> +		pnum = xmalloc(sizeof(u32));
> >> +		*pnum = num;
> >> +		globalvar_add_simple_int("vc.boot_partition", pnum, "%u");
> 
> You could use setenv() with a format string instead, see Sascha's change to
> the mailing list, this would simplify this chunk here.

You can't create a globalvar with setenv().

Anyway, when I see this hunk I want to suggest to just use a global
static variable instead of allocating memory dynamically for it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list