OSDN Git Service

[GCC4] fix build error in drivers/ide/legacy/hd.c
authorWilly Tarreau <w@1wt.eu>
Sun, 13 Aug 2006 08:34:54 +0000 (10:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 Aug 2006 15:19:24 +0000 (17:19 +0200)
This patch fixes this error with gcc 4 :

hd.c:721: error: static declaration of 'hd_fops' follows non-static declaration
hd.c:697: error: previous declaration of 'hd_fops' was here
make[4]: *** [hd.o] Error 1
make[4]: Leaving directory `/usr/src/git/linux-2.4/drivers/ide/legacy'
make[3]: *** [first_rule] Error 2
make[3]: Leaving directory `/usr/src/git/linux-2.4/drivers/ide/legacy'
make[2]: *** [_subdir_legacy] Error 2
make[2]: Leaving directory `/usr/src/git/linux-2.4/drivers/ide'
make[1]: *** [_subdir_ide] Error 2
make[1]: Leaving directory `/usr/src/git/linux-2.4/drivers'
make: *** [_dir_drivers] Error 2

drivers/ide/legacy/hd.c

index 3c7b0e0..353a0e2 100644 (file)
@@ -694,7 +694,11 @@ static int hd_release(struct inode * inode, struct file * file)
        return 0;
 }
 
-extern struct block_device_operations hd_fops;
+static struct block_device_operations hd_fops = {
+       open:           hd_open,
+       release:        hd_release,
+       ioctl:          hd_ioctl,
+};
 
 static struct gendisk hd_gendisk = {
        major:          MAJOR_NR,
@@ -718,12 +722,6 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        sti();
 }
 
-static struct block_device_operations hd_fops = {
-       open:           hd_open,
-       release:        hd_release,
-       ioctl:          hd_ioctl,
-};
-
 /*
  * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags
  * means we run the IRQ-handler with interrupts disabled:  this is bad for