diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-11-30 20:44:49 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-12-07 16:26:16 +0000 |
commit | 05f96ef1189ecbf2e8548056a0ca016e4f630cef (patch) | |
tree | 1e4ef81835135bdfae2243d8033b3b5df0a61523 /arch | |
parent | b7dc96d75309346c1213875be68fdbbec92da5e7 (diff) | |
download | linux-stable-05f96ef1189ecbf2e8548056a0ca016e4f630cef.tar.gz linux-stable-05f96ef1189ecbf2e8548056a0ca016e4f630cef.tar.bz2 linux-stable-05f96ef1189ecbf2e8548056a0ca016e4f630cef.zip |
[ARM] Allow gcc to optimise arm_add_memory a little more
For some reason, gcc was calculating meminfo.bank[meminfo.nr_banks]
repeatedly. Use a pointer to it instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/setup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 29efc9f82057..75f1764933ab 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -441,16 +441,19 @@ __early_param("initrd=", early_initrd); static void __init arm_add_memory(unsigned long start, unsigned long size) { + struct membank *bank; + /* * Ensure that start/size are aligned to a page boundary. * Size is appropriately rounded down, start is rounded up. */ size -= start & ~PAGE_MASK; - meminfo.bank[meminfo.nr_banks].start = PAGE_ALIGN(start); - meminfo.bank[meminfo.nr_banks].size = size & PAGE_MASK; - meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start); - meminfo.nr_banks += 1; + bank = &meminfo.bank[meminfo.nr_banks++]; + + bank->start = PAGE_ALIGN(start); + bank->size = size & PAGE_MASK; + bank->node = PHYS_TO_NID(start); } /* |