[PATCH 17/25] imx/eukrea_cpuimx27: use new nand device registration

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Nov 16 17:32:37 EST 2009


On Mon, Nov 16, 2009 at 09:35:00PM +0100, Uwe Kleine-König wrote:
>  static void __init eukrea_cpuimx27_init(void)
>  {
> +	struct mxc_nand_platform_data mxc_nand_pdata = {
> +		.width = 1,
> +		.hw_ecc = 1,
> +	};
> +

Have you checked what code the compiler spits out for this?

What the compiler will do is create a copy of the structure data in the
read-only data section.  It will allocate space on the stack, and memcpy
from that read-only version to the stack version.  It will then use the
stacked version for mxc_nand_data.

This saves nothing - the data remains in-core.

What you want to do is to keep the original definition, and mark it with
__initdata so that it gets discarded.



More information about the linux-arm-kernel mailing list