* [PATCH] hw/nios2/boot: Remove dead code (big endian check)
@ 2020-02-25 11:51 Philippe Mathieu-Daudé
2020-03-03 10:02 ` Laurent Vivier
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-25 11:51 UTC (permalink / raw)
To: qemu-devel
Cc: Marek Vasut, Peter Maydell, Andrew Jenner, qemu-trivial,
Chris Wulff, Julian Brown, Sandra Loosemore,
Philippe Mathieu-Daudé, Richard Henderson
We only build the little-endian softmmu configuration (all
Nios II processors are only little endian). Checking for
big endian is pointless, remove the unused code.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/nios2/boot.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
index 88224aa84c..000f8205d6 100644
--- a/hw/nios2/boot.c
+++ b/hw/nios2/boot.c
@@ -140,16 +140,11 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
if (kernel_filename) {
int kernel_size, fdt_size;
uint64_t entry, low, high;
- int big_endian = 0;
-
-#ifdef TARGET_WORDS_BIGENDIAN
- big_endian = 1;
-#endif
/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, &low, &high, NULL,
- big_endian, EM_ALTERA_NIOS2, 0, 0);
+ 0, EM_ALTERA_NIOS2, 0, 0);
if ((uint32_t)entry == 0xc0000000) {
/*
* The Nios II processor reference guide documents that the
@@ -160,7 +155,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
&entry, NULL, NULL, NULL,
- big_endian, EM_ALTERA_NIOS2, 0, 0);
+ 0, EM_ALTERA_NIOS2, 0, 0);
boot_info.bootstrap_pc = ddr_base + 0xc0000000 +
(entry & 0x07ffffff);
} else {
--
2.21.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hw/nios2/boot: Remove dead code (big endian check)
2020-02-25 11:51 [PATCH] hw/nios2/boot: Remove dead code (big endian check) Philippe Mathieu-Daudé
@ 2020-03-03 10:02 ` Laurent Vivier
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2020-03-03 10:02 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Marek Vasut, Peter Maydell, Andrew Jenner, qemu-trivial,
Chris Wulff, Julian Brown, Sandra Loosemore, Richard Henderson
Le 25/02/2020 à 12:51, Philippe Mathieu-Daudé a écrit :
> We only build the little-endian softmmu configuration (all
> Nios II processors are only little endian). Checking for
> big endian is pointless, remove the unused code.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/nios2/boot.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
> index 88224aa84c..000f8205d6 100644
> --- a/hw/nios2/boot.c
> +++ b/hw/nios2/boot.c
> @@ -140,16 +140,11 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
> if (kernel_filename) {
> int kernel_size, fdt_size;
> uint64_t entry, low, high;
> - int big_endian = 0;
> -
> -#ifdef TARGET_WORDS_BIGENDIAN
> - big_endian = 1;
> -#endif
>
> /* Boots a kernel elf binary. */
> kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
> &entry, &low, &high, NULL,
> - big_endian, EM_ALTERA_NIOS2, 0, 0);
> + 0, EM_ALTERA_NIOS2, 0, 0);
> if ((uint32_t)entry == 0xc0000000) {
> /*
> * The Nios II processor reference guide documents that the
> @@ -160,7 +155,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
> kernel_size = load_elf(kernel_filename, NULL,
> translate_kernel_address, NULL,
> &entry, NULL, NULL, NULL,
> - big_endian, EM_ALTERA_NIOS2, 0, 0);
> + 0, EM_ALTERA_NIOS2, 0, 0);
> boot_info.bootstrap_pc = ddr_base + 0xc0000000 +
> (entry & 0x07ffffff);
> } else {
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-03 10:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-25 11:51 [PATCH] hw/nios2/boot: Remove dead code (big endian check) Philippe Mathieu-Daudé
2020-03-03 10:02 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).