diff options
| author | Tiwei Bie <tiwei.btw@antgroup.com> | 2025-10-27 13:45:18 +0800 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-10-27 16:37:12 +0100 |
| commit | 9c84022c1d1f0cfd8f02fa8e2b275ccd361891d2 (patch) | |
| tree | 1225c93e5da6143e6877dad5eabc93653a40a99b /arch/um/kernel/um_arch.c | |
| parent | de203267483de10bdfc3ec74fac246e879361819 (diff) | |
um: Replace UML_ROUND_UP() with PAGE_ALIGN()
Although UML_ROUND_UP() is defined in a shared header file, it
depends on the PAGE_SIZE and PAGE_MASK macros, so it can only be
used in kernel code. Considering its name is not very clear and
its functionality is the same as PAGE_ALIGN(), replace its usages
with a direct call to PAGE_ALIGN() and remove it.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20251027054519.1996090-4-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/kernel/um_arch.c')
| -rw-r--r-- | arch/um/kernel/um_arch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index fcabef8c7224..6f9a49e6c6a0 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -348,12 +348,11 @@ int __init linux_main(int argc, char **argv, char **envp) * so they actually get what they asked for. This should * add zero for non-exec shield users */ - - diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); + diff = PAGE_ALIGN(brk_start) - PAGE_ALIGN((unsigned long) &_end); if (diff > 1024 * 1024) { os_info("Adding %ld bytes to physical memory to account for " "exec-shield gap\n", diff); - physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); + physmem_size += diff; } uml_physmem = (unsigned long) __binary_start & PAGE_MASK; |