mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
efi: Tidy up device-tree-size calculation in copy_fdt()
This is a bit confusing at present since it adds 4KB to the pointer, then rounds it up. It looks like a bug, but is not. Move the 4KB addition into a separate statement and expand the comment. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
404ea59364
commit
bc9a638a10
1 changed files with 6 additions and 2 deletions
|
@ -148,8 +148,12 @@ static void *copy_fdt(void *fdt)
|
|||
fdt_ram_start = ram_start;
|
||||
}
|
||||
|
||||
/* Give us at least 4kb breathing room */
|
||||
fdt_size = ALIGN(fdt_size + 4096, EFI_PAGE_SIZE);
|
||||
/*
|
||||
* Give us at least 4KB of breathing room in case the device tree needs
|
||||
* to be expanded later. Round up to the nearest EFI page boundary.
|
||||
*/
|
||||
fdt_size += 4096;
|
||||
fdt_size = ALIGN(fdt_size + EFI_PAGE_SIZE - 1, EFI_PAGE_SIZE);
|
||||
fdt_pages = fdt_size >> EFI_PAGE_SHIFT;
|
||||
|
||||
/* Safe fdt location is at 128MB */
|
||||
|
|
Loading…
Add table
Reference in a new issue