ide: Clean up ide_exec_cmd()
All commands are now converted to ide_cmd_table handlers, so it can be unconditional now and the old switch block can go. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
ff35267730
commit
dfe1ea8fc4
@ -1694,6 +1694,7 @@ static bool ide_cmd_permitted(IDEState *s, uint32_t cmd)
|
|||||||
void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
||||||
{
|
{
|
||||||
IDEState *s;
|
IDEState *s;
|
||||||
|
bool complete;
|
||||||
|
|
||||||
#if defined(DEBUG_IDE)
|
#if defined(DEBUG_IDE)
|
||||||
printf("ide: CMD=%02x\n", val);
|
printf("ide: CMD=%02x\n", val);
|
||||||
@ -1708,12 +1709,11 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ide_cmd_permitted(s, val)) {
|
if (!ide_cmd_permitted(s, val)) {
|
||||||
goto abort_cmd;
|
ide_abort_command(s);
|
||||||
|
ide_set_irq(s->bus);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ide_cmd_table[val].handler != NULL) {
|
|
||||||
bool complete;
|
|
||||||
|
|
||||||
s->status = READY_STAT | BUSY_STAT;
|
s->status = READY_STAT | BUSY_STAT;
|
||||||
s->error = 0;
|
s->error = 0;
|
||||||
|
|
||||||
@ -1728,18 +1728,6 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
|||||||
|
|
||||||
ide_set_irq(s->bus);
|
ide_set_irq(s->bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(val) {
|
|
||||||
default:
|
|
||||||
/* should not be reachable */
|
|
||||||
abort_cmd:
|
|
||||||
ide_abort_command(s);
|
|
||||||
ide_set_irq(s->bus);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ide_ioport_read(void *opaque, uint32_t addr1)
|
uint32_t ide_ioport_read(void *opaque, uint32_t addr1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user