bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Duplicate floppy.c


From: Andrea Monaco
Subject: Duplicate floppy.c
Date: Wed, 15 Sep 2021 15:22:35 +0200

Hello,


gnumach has two floppy.c files and they are almost identical, as you can
see from the diff. The second one seems more polished to me; also
removing the first doesn't alter the build, so perhaps it is a dead
file.



--- linux/src/drivers/block/floppy.c    2020-11-24 19:57:27.713413294 +0100
+++ linux/dev/drivers/block/floppy.c    2020-11-24 19:57:27.697413296 +0100
@@ -438,7 +438,11 @@
 
 static volatile int command_status = FD_COMMAND_NONE, fdc_busy = 0;
 static struct wait_queue *fdc_wait = NULL, *command_done = NULL;
+#ifdef MACH
+#define NO_SIGNAL (! issig () || ! interruptible)
+#else
 #define NO_SIGNAL (!(current->signal & ~current->blocked) || !interruptible)
+#endif
 #define CALL(x) if ((x) == -EINTR) return -EINTR
 #define ECALL(x) if ((ret = (x))) return ret;
 #define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
@@ -1409,7 +1413,7 @@
  */
 static void setup_rw_floppy(void)
 {
-       int i,ready_date,r, flags,dflags;
+       int i, ready_date, r, flags;
        timeout_fn function;
 
        flags = raw_cmd->flags;
@@ -1432,7 +1436,6 @@
                if (wait_for_completion(ready_date,function))
                        return;
        }
-       dflags = DRS->flags;
 
        if ((flags & FD_RAW_READ) || (flags & FD_RAW_WRITE))
                setup_DMA();
@@ -3489,6 +3492,8 @@
                                printk("fd%d is unknown type %d",drive,
                                       UDP->cmos);
                }
+                       else
+                               allowed_drive_mask &= ~(1 << drive);
        }
        if (!first)
                printk("\n");
@@ -3718,7 +3723,7 @@
                                return 1;
                        }
                        if (bh && !buffer_uptodate(bh))
-                               ll_rw_block(READ, 1, &bh);
+                               ll_rw_block(READ, 1, &bh, 1);
                        process_fd_request();
                        wait_on_buffer(bh);
                        brelse(bh);
@@ -4272,11 +4277,10 @@
  * resource contention. */
 void floppy_eject(void)
 {
-       int dummy;
        if(floppy_grab_irq_and_dma()==0)
        {
                lock_fdc(MAXTIMEOUT,0);
-               dummy=fd_eject(0);
+               fd_eject(0);
                process_fd_request();
                floppy_release_irq_and_dma();
        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]