[U-Boot] [PATCH 01/15] Make bootm optionally use pre-existing atags for Linux kernel boot.

Mike Frysinger vapier at gentoo.org
Thu Sep 1 15:52:08 CEST 2011


> +#ifdef CONFIG_CHAINLOADER
> +	uint	params;
> +	#define PARAMS params
> +#else
> +	#define PARAMS (bd->bi_boot_params)
> +#endif

do not indent the "#" with preprocessors

also, this can be rewritten a bit.  always declare uint params regardless of 
the define, and then when in the chainloader logic, set it to the env value, 
otherwise set it to bd->bi_boot_params.  then you can delete this dedicated 
and ugly "PARAMS" define.

> +#ifdef CONFIG_CHAINLOADER

this is kind of a crappy define.  how about "CONFIG_ATAGSADDR".

also, you'll need to update toplevel README to document the new option.

> +	s = getenv ("atags");

"atagsaddr" is probably a better name as a plain "atags" can be interpreted 
multiple ways

> +		params = simple_strtoul (s, NULL, 16);

no spaces before the open paren in func calls.
wrong: foo (a);
right: foo(a);

> +		printf ("Using existing atags at 0x%x\n", params);

0x%x -> %#x
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110901/521a388d/attachment.pgp 


More information about the U-Boot mailing list