aboutsummaryrefslogtreecommitdiff
path: root/hw/mips/fuloong2e.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-09-27 13:18:17 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-17 13:59:40 +0200
commitacab36ca25101930b263dd9e8afd9b244354d338 (patch)
tree2e1e801b61aac4df59e1b948b92f33a7ebf19e4b /hw/mips/fuloong2e.c
parent9d585eaa87bf1c5f66e12d6c4a8a38c80f69c5da (diff)
downloadqemu-acab36ca25101930b263dd9e8afd9b244354d338.zip
qemu-acab36ca25101930b263dd9e8afd9b244354d338.tar.gz
qemu-acab36ca25101930b263dd9e8afd9b244354d338.tar.bz2
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/fuloong2e.c')
-rw-r--r--hw/mips/fuloong2e.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index b8234f6..de66215 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -133,8 +133,7 @@ static int64_t load_kernel(CPUMIPSState *env)
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 > ram_size) {
error_report("memory too small for initial ram disk '%s'",
loaderparams.initrd_filename);