]> git.proxmox.com Git - mirror_qemu.git/commit
hw/i386/x86: Eliminate two if statements in x86_bios_rom_init()
authorBernhard Beschow <shentey@gmail.com>
Tue, 30 Apr 2024 15:06:38 +0000 (17:06 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 8 May 2024 17:43:23 +0000 (19:43 +0200)
commit014dbdac8798799d081abc9dff3e4876ca54f49e
tree691736a6d7140366d429716b02895ba59d183e63
parent8793d601f38b417d63820456582e1e22e51c2d34
hw/i386/x86: Eliminate two if statements in x86_bios_rom_init()

Given that memory_region_set_readonly() is a no-op when the readonlyness is
already as requested it is possible to simplify the pattern

  if (condition) {
    foo(true);
  }

to

  foo(condition);

which is shorter and allows to see the invariant of the code more easily.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240430150643.111976-2-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/i386/x86.c