[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/15] digic: stash firmware into DigicState
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 02/15] digic: stash firmware into DigicState |
Date: |
Mon, 26 Oct 2020 16:05:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 26/10/20 15:44, Peter Maydell wrote:
> Anyway, rather than stashing the firmware filename in the
> DigicState, you could lift the "decide whether to use
> machine->firmware or the def_filename" choice up to
> the callsites in digic4_board_init():
>
> if (board->add_rom0) {
> board->add_rom0(s, DIGIC4_ROM0_BASE,
> machine->firmware ?: board->rom0_def_filename);
> }
> (and similarly for rom1).
>
> Then you can delete the
> if (bios_name) {
> filename = bios_name;
> } else {
> filename = def_filename;
> }
> block from digic_load_rom() and rename the arguments of
> digic_load_rom() and digic4_add_k8p3215uqb_rom() to just
> "filename" rather than "def_filename".
>
> Doing it that way avoids passing things around that we don't
> need to, and makes it clear in the digic4_board_init() code
> that we're doing something a bit suspect in possibly using
> the machine->firmware file twice -- if we ever need to fix
> that bug then it'll be a simple change to the logic in that
> one function.
Much better indeed, thanks!
Paolo
- [PATCH 00/15] remove bios_name variable, Paolo Bonzini, 2020/10/26
- [PATCH 05/15] i386: remove bios_name, Paolo Bonzini, 2020/10/26
- [PATCH 01/15] alpha: remove bios_name, Paolo Bonzini, 2020/10/26
- [PATCH 02/15] digic: stash firmware into DigicState, Paolo Bonzini, 2020/10/26
- [PATCH 04/15] hppa: remove bios_name, Paolo Bonzini, 2020/10/26
- [PATCH 12/15] s390: remove bios_name, Paolo Bonzini, 2020/10/26
- [PATCH 09/15] moxie: remove bios_name, Paolo Bonzini, 2020/10/26