mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/7] arm: export arch_number to env
Date: Mon, 19 Sep 2011 11:14:46 +0200	[thread overview]
Message-ID: <20110919091445.GF31404@pengutronix.de> (raw)
In-Reply-To: <1316175828-19748-1-git-send-email-plagnioj@jcrosoft.com>

On Fri, Sep 16, 2011 at 02:23:42PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can dynamise the boot depending on the machine
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/lib/armlinux.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index 5bdbb92..9f2ecd2 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -184,9 +184,16 @@ void armlinux_set_bootparams(void *params)
>  	armlinux_bootparams = params;
>  }
>  
> +static char *arch_number;
> +
>  void armlinux_set_architecture(int architecture)
>  {
>  	armlinux_architecture = architecture;
> +
> +	kfree(arch_number);
> +	arch_number = asprintf("%d", architecture);
> +	setenv("arch_number", arch_number);
> +	export("arch_number");
>  }

like this please:

void armlinux_set_architecture(int architecture)
{
	char *arch_number = asprintf("%d", architecture);

	armlinux_architecture = architecture;
	setenv("arch_number", arch_number);
	export("arch_number");

	free(arch_number);
}

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2011-09-19  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 12:23 Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 2/7] at91: fix cpu clock speed display Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 3/7] at91: Fix uhpck clock rate in upll case Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 4/7] at91/boards: switch to software ecc as in linux kernel Jean-Christophe PLAGNIOL-VILLARD
2011-09-19  9:18   ` Sascha Hauer
2011-09-19  9:37     ` Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 5/7] resource: introduce add_generic_device_res to add multiple resource Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 6/7] at91: nand switch ecc base to resource Jean-Christophe PLAGNIOL-VILLARD
2011-09-16 12:23 ` [PATCH 7/7] usb/core: make print dev like linux lsusb Jean-Christophe PLAGNIOL-VILLARD
2011-09-19  9:14 ` 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=20110919091445.GF31404@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.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