OSDN Git Service

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

xd.c:141: error: static declaration of 'xd_fops' follows non-static declaration
xd.c:128: error: previous declaration of 'xd_fops' was here

drivers/block/xd.c

index 5014c45..8f72792 100644 (file)
@@ -125,7 +125,12 @@ static int xd_sizes[XD_MAXDRIVES << 6], xd_access[XD_MAXDRIVES];
 static int xd_blocksizes[XD_MAXDRIVES << 6];
 static int xd_maxsect[XD_MAXDRIVES << 6];
 
-extern struct block_device_operations xd_fops;
+static struct block_device_operations xd_fops = {
+       owner:          THIS_MODULE,
+       open:           xd_open,
+       release:        xd_release,
+       ioctl:          xd_ioctl,
+};
 
 static struct gendisk xd_gendisk = {
        major:          MAJOR_NR,
@@ -138,13 +143,6 @@ static struct gendisk xd_gendisk = {
        fops:           &xd_fops,
 };
 
-static struct block_device_operations xd_fops = {
-       owner:          THIS_MODULE,
-       open:           xd_open,
-       release:        xd_release,
-       ioctl:          xd_ioctl,
-};
-
 static DECLARE_WAIT_QUEUE_HEAD(xd_wait_int);
 static DECLARE_WAIT_QUEUE_HEAD(xd_wait_open);
 static u8 xd_valid[XD_MAXDRIVES] = { 0,0 };