diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-09-27 13:18:17 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-10-17 13:59:40 +0200 |
commit | acab36ca25101930b263dd9e8afd9b244354d338 (patch) | |
tree | 2e1e801b61aac4df59e1b948b92f33a7ebf19e4b /hw/mips/mipssim.c | |
parent | 9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da (diff) |
hw/mips: Simplify code using ROUND_UP(INITRD_PAGE_SIZE)
Instead of using a INITRD_PAGE_MASK definition, use the
simpler INITRD_PAGE_SIZE one which allows us to simplify
the code by using directly the self-explicit ROUND_UP()
macro.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200927163943.614604-3-f4bug@amsat.org>
Diffstat (limited to 'hw/mips/mipssim.c')
-rw-r--r-- | hw/mips/mipssim.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index afef4f2e77..97dcc23247 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -90,8 +90,7 @@ static int64_t load_kernel(void) if (loaderparams.initrd_filename) { initrd_size = get_image_size(loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & - INITRD_PAGE_MASK; + initrd_offset = ROUND_UP(kernel_high, INITRD_PAGE_SIZE); if (initrd_offset + initrd_size > loaderparams.ram_size) { error_report("memory too small for initial ram disk '%s'", loaderparams.initrd_filename); |