Patchwork [v3,9/9] fdc: DIR (Digital Input Register) should return status of current drive...

login
register
mail settings
Submitter Hervé Poussineau
Date Jan. 23, 2012, 8:50 a.m.
Message ID <1327308641-14736-10-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/137325/
State New
Headers show

Comments

Hervé Poussineau - Jan. 23, 2012, 8:50 a.m.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/fdc.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
Markus Armbruster - Jan. 27, 2012, 8:57 a.m.
Impact?  What exactly is broken and fixed?

Patch

diff --git a/hw/fdc.c b/hw/fdc.c
index 3fa7704..79a7190 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -215,6 +215,7 @@  static void fdctrl_reset_fifo(FDCtrl *fdctrl);
 static int fdctrl_transfer_handler (void *opaque, int nchan,
                                     int dma_pos, int dma_len);
 static void fdctrl_raise_irq(FDCtrl *fdctrl, uint8_t status0);
+static FDrive *get_cur_drv(FDCtrl *fdctrl);
 
 static uint32_t fdctrl_read_statusA(FDCtrl *fdctrl);
 static uint32_t fdctrl_read_statusB(FDCtrl *fdctrl);
@@ -934,14 +935,9 @@  static uint32_t fdctrl_read_dir(FDCtrl *fdctrl)
 {
     uint32_t retval = 0;
 
-    if (fdctrl_media_changed(drv0(fdctrl))
-     || fdctrl_media_changed(drv1(fdctrl))
-#if MAX_FD == 4
-     || fdctrl_media_changed(drv2(fdctrl))
-     || fdctrl_media_changed(drv3(fdctrl))
-#endif
-        )
+    if (fdctrl_media_changed(get_cur_drv(fdctrl))) {
         retval |= FD_DIR_DSKCHG;
+    }
     if (retval != 0) {
         FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);
     }