diff options
author | BALATON Zoltan <balaton@eik.bme.hu> | 2021-01-09 21:16:36 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-02-21 19:42:34 +0100 |
commit | b7741b7742573aff43398dd34c6bd4c6eed0fce7 (patch) | |
tree | edf8666f64dc95dad58212beb7485d1949d2b169 /hw/isa/vt82c686.c | |
parent | 2b98dca9571a1019fcc97694b6220f9301dddd7d (diff) |
vt82c686: Simplify by returning earlier
By returning earlier we can remove the 'can_write' boolean variable.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <15b2968fd300a12d06b42368d084f6f80d3c3be5.1610223397.git.balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: Split original patch in 5, this is part 3/5]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/isa/vt82c686.c')
-rw-r--r-- | hw/isa/vt82c686.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 2f69b4d531..2bd10d9101 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -258,7 +258,6 @@ static void superio_cfg_write(void *opaque, hwaddr addr, uint64_t data, { SuperIOConfig *sc = opaque; uint8_t idx = sc->regs[0]; - bool can_write = true; if (addr == 0x3f0) { /* config index register */ idx = data & 0xff; @@ -276,15 +275,13 @@ static void superio_cfg_write(void *opaque, hwaddr addr, uint64_t data, case 0xf7: case 0xf9 ... 0xfb: case 0xfd ... 0xff: - can_write = false; - break; + /* ignore write to read only registers */ + return; /* case 0xe6 ... 0xe8: Should set base port of parallel and serial */ default: break; } - if (can_write) { - sc->regs[idx] = data & 0xff; - } + sc->regs[idx] = data & 0xff; } static uint64_t superio_cfg_read(void *opaque, hwaddr addr, unsigned size) |