Skip to content
Snippets Groups Projects
Commit 2b98dca9 authored by BALATON Zoltan's avatar BALATON Zoltan Committed by Philippe Mathieu-Daudé
Browse files

vt82c686: Reduce indentation by returning early


Signed-off-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <15b2968fd300a12d06b42368d084f6f80d3c3be5.1610223397.git.balaton@eik.bme.hu>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: Split patch original in 5, this is part 2/5]
Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
parent c953bf71
No related branches found
No related tags found
No related merge requests found
......@@ -258,33 +258,32 @@ 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;
} else {
bool can_write = true;
/* 0x3f1, config data register */
trace_via_superio_write(idx, data & 0xff);
switch (idx) {
case 0x00 ... 0xdf:
case 0xe4:
case 0xe5:
case 0xe9 ... 0xed:
case 0xf3:
case 0xf5:
case 0xf7:
case 0xf9 ... 0xfb:
case 0xfd ... 0xff:
can_write = false;
break;
/* case 0xe6 ... 0xe8: Should set base port of parallel and serial */
default:
break;
}
if (can_write) {
sc->regs[idx] = data & 0xff;
}
return;
}
/* 0x3f1, config data register */
trace_via_superio_write(idx, data & 0xff);
switch (idx) {
case 0x00 ... 0xdf:
case 0xe4:
case 0xe5:
case 0xe9 ... 0xed:
case 0xf3:
case 0xf5:
case 0xf7:
case 0xf9 ... 0xfb:
case 0xfd ... 0xff:
can_write = false;
break;
/* case 0xe6 ... 0xe8: Should set base port of parallel and serial */
default:
break;
}
if (can_write) {
sc->regs[idx] = data & 0xff;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment