qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] hw/i386/x86: Eliminate two if statements in x86_bios_rom


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/4] hw/i386/x86: Eliminate two if statements in x86_bios_rom_init()
Date: Thu, 25 Apr 2024 09:07:10 +0200
User-agent: Mozilla Thunderbird

On 22/4/24 22:06, Bernhard Beschow wrote:
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>
---
  hw/i386/x86.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]