mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 17:43:59 +00:00
[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>
This commit is contained in:
parent
b7dc96d753
commit
05f96ef118
@ -441,16 +441,19 @@ __early_param("initrd=", early_initrd);
|
|||||||
|
|
||||||
static void __init arm_add_memory(unsigned long start, unsigned long size)
|
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.
|
* Ensure that start/size are aligned to a page boundary.
|
||||||
* Size is appropriately rounded down, start is rounded up.
|
* Size is appropriately rounded down, start is rounded up.
|
||||||
*/
|
*/
|
||||||
size -= start & ~PAGE_MASK;
|
size -= start & ~PAGE_MASK;
|
||||||
|
|
||||||
meminfo.bank[meminfo.nr_banks].start = PAGE_ALIGN(start);
|
bank = &meminfo.bank[meminfo.nr_banks++];
|
||||||
meminfo.bank[meminfo.nr_banks].size = size & PAGE_MASK;
|
|
||||||
meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
|
bank->start = PAGE_ALIGN(start);
|
||||||
meminfo.nr_banks += 1;
|
bank->size = size & PAGE_MASK;
|
||||||
|
bank->node = PHYS_TO_NID(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user