mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: "Daniel Brát" <danek.brat@gmail.com>, barebox@lists.infradead.org
Subject: Re: [PATCH v3] ARM: rpi: parse useful data from vc fdt
Date: Fri, 17 Jun 2022 11:33:08 +0200	[thread overview]
Message-ID: <20220617093308.GL1615@pengutronix.de> (raw)
In-Reply-To: <bf7af9b5-51f7-0c9a-4c51-47ce042e1585@pengutronix.de>

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 |



      reply	other threads:[~2022-06-17  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 18:41 Daniel Brát
2022-06-17  7:08 ` Ahmad Fatoum
2022-06-17  8:55   ` Ahmad Fatoum
2022-06-17  9:33     ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617093308.GL1615@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=danek.brat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox