diff mbox series

[2/6] hw/loader: Remove unused load_elf_ram()

Message ID 20250127113824.50177-3-philmd@linaro.org (mailing list archive)
State New
Headers show
Series hw/loader: Pass ELFDATA endian order argument to load_elf() | expand

Commit Message

Philippe Mathieu-Daudé Jan. 27, 2025, 11:38 a.m. UTC
Last use of load_elf_ram() was removed in commit 188e255bf8e
("hw/s390x: Remove the possibility to load the s390-netboot.img
binary"), remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/loader.h | 14 +-------------
 hw/core/loader.c    | 16 +---------------
 2 files changed, 2 insertions(+), 28 deletions(-)

Comments

Richard Henderson Jan. 27, 2025, 9:12 p.m. UTC | #1
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote:
> Last use of load_elf_ram() was removed in commit 188e255bf8e
> ("hw/s390x: Remove the possibility to load the s390-netboot.img
> binary"), remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/hw/loader.h | 14 +-------------
>   hw/core/loader.c    | 16 +---------------
>   2 files changed, 2 insertions(+), 28 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Alistair Francis Jan. 28, 2025, 2:14 a.m. UTC | #2
On Mon, Jan 27, 2025 at 9:39 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Last use of load_elf_ram() was removed in commit 188e255bf8e
> ("hw/s390x: Remove the possibility to load the s390-netboot.img
> binary"), remove it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  include/hw/loader.h | 14 +-------------
>  hw/core/loader.c    | 16 +---------------
>  2 files changed, 2 insertions(+), 28 deletions(-)
>
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index 8985046be40..9bb34e6f062 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -155,20 +155,8 @@ ssize_t load_elf_ram_sym(const char *filename,
>                           int clear_lsb, int data_swab,
>                           AddressSpace *as, bool load_rom, symbol_fn_t sym_cb);
>
> -/** load_elf_ram:
> - * Same as load_elf_ram_sym(), but doesn't allow the caller to specify a
> - * symbol callback function
> - */
> -ssize_t load_elf_ram(const char *filename,
> -                     uint64_t (*elf_note_fn)(void *, void *, bool),
> -                     uint64_t (*translate_fn)(void *, uint64_t),
> -                     void *translate_opaque, uint64_t *pentry,
> -                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
> -                     int big_endian, int elf_machine, int clear_lsb,
> -                     int data_swab, AddressSpace *as, bool load_rom);
> -
>  /** load_elf_as:
> - * Same as load_elf_ram(), but always loads the elf as ROM
> + * Same as load_elf_ram_sym(), but always loads the elf as ROM
>   */
>  ssize_t load_elf_as(const char *filename,
>                      uint64_t (*elf_note_fn)(void *, void *, bool),
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 4dfdb027eee..ead10fb6cb5 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -425,26 +425,12 @@ ssize_t load_elf_as(const char *filename,
>                      uint64_t *highaddr, uint32_t *pflags, int big_endian,
>                      int elf_machine, int clear_lsb, int data_swab,
>                      AddressSpace *as)
> -{
> -    return load_elf_ram(filename, elf_note_fn, translate_fn, translate_opaque,
> -                        pentry, lowaddr, highaddr, pflags, big_endian,
> -                        elf_machine, clear_lsb, data_swab, as, true);
> -}
> -
> -/* return < 0 if error, otherwise the number of bytes loaded in memory */
> -ssize_t load_elf_ram(const char *filename,
> -                     uint64_t (*elf_note_fn)(void *, void *, bool),
> -                     uint64_t (*translate_fn)(void *, uint64_t),
> -                     void *translate_opaque, uint64_t *pentry,
> -                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
> -                     int big_endian, int elf_machine, int clear_lsb,
> -                     int data_swab, AddressSpace *as, bool load_rom)
>  {
>      return load_elf_ram_sym(filename, elf_note_fn,
>                              translate_fn, translate_opaque,
>                              pentry, lowaddr, highaddr, pflags, big_endian,
>                              elf_machine, clear_lsb, data_swab, as,
> -                            load_rom, NULL);
> +                            true, NULL);
>  }
>
>  /* return < 0 if error, otherwise the number of bytes loaded in memory */
> --
> 2.47.1
>
>
diff mbox series

Patch

diff --git a/include/hw/loader.h b/include/hw/loader.h
index 8985046be40..9bb34e6f062 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -155,20 +155,8 @@  ssize_t load_elf_ram_sym(const char *filename,
                          int clear_lsb, int data_swab,
                          AddressSpace *as, bool load_rom, symbol_fn_t sym_cb);
 
-/** load_elf_ram:
- * Same as load_elf_ram_sym(), but doesn't allow the caller to specify a
- * symbol callback function
- */
-ssize_t load_elf_ram(const char *filename,
-                     uint64_t (*elf_note_fn)(void *, void *, bool),
-                     uint64_t (*translate_fn)(void *, uint64_t),
-                     void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
-                     int big_endian, int elf_machine, int clear_lsb,
-                     int data_swab, AddressSpace *as, bool load_rom);
-
 /** load_elf_as:
- * Same as load_elf_ram(), but always loads the elf as ROM
+ * Same as load_elf_ram_sym(), but always loads the elf as ROM
  */
 ssize_t load_elf_as(const char *filename,
                     uint64_t (*elf_note_fn)(void *, void *, bool),
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 4dfdb027eee..ead10fb6cb5 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -425,26 +425,12 @@  ssize_t load_elf_as(const char *filename,
                     uint64_t *highaddr, uint32_t *pflags, int big_endian,
                     int elf_machine, int clear_lsb, int data_swab,
                     AddressSpace *as)
-{
-    return load_elf_ram(filename, elf_note_fn, translate_fn, translate_opaque,
-                        pentry, lowaddr, highaddr, pflags, big_endian,
-                        elf_machine, clear_lsb, data_swab, as, true);
-}
-
-/* return < 0 if error, otherwise the number of bytes loaded in memory */
-ssize_t load_elf_ram(const char *filename,
-                     uint64_t (*elf_note_fn)(void *, void *, bool),
-                     uint64_t (*translate_fn)(void *, uint64_t),
-                     void *translate_opaque, uint64_t *pentry,
-                     uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
-                     int big_endian, int elf_machine, int clear_lsb,
-                     int data_swab, AddressSpace *as, bool load_rom)
 {
     return load_elf_ram_sym(filename, elf_note_fn,
                             translate_fn, translate_opaque,
                             pentry, lowaddr, highaddr, pflags, big_endian,
                             elf_machine, clear_lsb, data_swab, as,
-                            load_rom, NULL);
+                            true, NULL);
 }
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */