[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/5] ide: do not set s->end_transfer_func to ide_tra
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 3/5] ide: do not set s->end_transfer_func to ide_transfer_cancel |
Date: |
Fri, 23 Feb 2018 16:26:38 +0100 |
There is code checking s->end_transfer_func and it was not taught
about ide_transfer_cancel. We can just use ide_transfer_stop because
s->end_transfer_func is only ever called in the DRQ phase: after
ide_transfer_cancel, the value of s->end_transfer_func is only used
as a marker and never used to actually invoke the function.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/ide/core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index c4710a6f55..447d9624df 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -553,10 +553,9 @@ static void ide_cmd_done(IDEState *s)
}
}
-static void ide_transfer_halt(IDEState *s,
- void(*end_transfer_func)(IDEState *))
+static void ide_transfer_halt(IDEState *s)
{
- s->end_transfer_func = end_transfer_func;
+ s->end_transfer_func = ide_transfer_stop;
s->data_ptr = s->io_buffer;
s->data_end = s->io_buffer;
s->status &= ~DRQ_STAT;
@@ -564,7 +563,7 @@ static void ide_transfer_halt(IDEState *s,
void ide_transfer_stop(IDEState *s)
{
- ide_transfer_halt(s, ide_transfer_stop);
+ ide_transfer_halt(s);
if (s->bus->dma->ops->end_transfer) {
s->bus->dma->ops->end_transfer(s->bus->dma);
}
@@ -573,7 +572,7 @@ void ide_transfer_stop(IDEState *s)
static void ide_transfer_cancel(IDEState *s)
{
- ide_transfer_halt(s, ide_transfer_cancel);
+ ide_transfer_halt(s);
}
int64_t ide_get_sector(IDEState *s)
--
2.14.3
- [Qemu-devel] [RFC PATCH 0/5] atapi: change unlimited recursion to while loop, Paolo Bonzini, 2018/02/23
- [Qemu-devel] [PATCH 3/5] ide: do not set s->end_transfer_func to ide_transfer_cancel,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 4/5] atapi: call ide_set_irq before ide_transfer_start, Paolo Bonzini, 2018/02/23
- [Qemu-devel] [PATCH 2/5] ide: push end_transfer callback to ide_transfer_halt, Paolo Bonzini, 2018/02/23
- [Qemu-devel] [PATCH 1/5] ide: push call to end_transfer_func out of start_transfer callback, Paolo Bonzini, 2018/02/23
- [Qemu-devel] [PATCH 5/5] ide: introduce ide_transfer_start_norecurse, Paolo Bonzini, 2018/02/23
- Re: [Qemu-devel] [RFC PATCH 0/5] atapi: change unlimited recursion to while loop, John Snow, 2018/02/27