aboutsummaryrefslogtreecommitdiff
path: root/hw/mips/mipssim.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-09-07 13:35:00 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-09-08 13:08:52 +0300
commitded625e7aa6a7f3173a22657f7dc0e9ab3d8fa3b (patch)
tree21c63bb1e087b0a4aa1cc1e6c4e6f25ef84c68e4 /hw/mips/mipssim.c
parentd417e2214d3adfd862bdf7afb3392e7f9de7fc05 (diff)
trivial: Simplify the spots that use TARGET_BIG_ENDIAN as a numeric value
TARGET_BIG_ENDIAN is *always* defined, either as 0 for little endian targets or as 1 for big endian targets. So we can use this as a value directly in places that need such a 0 or 1 for some reason, instead of taking a detour through an additional local variable or something similar. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/mips/mipssim.c')
-rw-r--r--hw/mips/mipssim.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index 39f64448f2..2f951f7fc6 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -62,18 +62,11 @@ static uint64_t load_kernel(void)
uint64_t entry, kernel_high, initrd_size;
long kernel_size;
ram_addr_t initrd_offset;
- int big_endian;
-
-#if TARGET_BIG_ENDIAN
- big_endian = 1;
-#else
- big_endian = 0;
-#endif
kernel_size = load_elf(loaderparams.kernel_filename, NULL,
cpu_mips_kseg0_to_phys, NULL,
&entry, NULL,
- &kernel_high, NULL, big_endian,
+ &kernel_high, NULL, TARGET_BIG_ENDIAN,
EM_MIPS, 1, 0);
if (kernel_size < 0) {
error_report("could not load kernel '%s': %s",