[PATCH] compile error mtrr/if.c

From: Ed Tomlinson (tomlins@cam.org)
Date: Sat Dec 21 2002 - 18:53:26 EST


Hi,

I get this compiling from bk current (Dec 21):

make -f scripts/Makefile.build obj=arch/i386/kernel/cpu/mtrr
  gcc -Wp,-MD,arch/i386/kernel/cpu/mtrr/.if.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -Iarch/i386/mach-generic -nostdinc -iwithprefix include -DKBUILD_BASENAME=if -DKBUILD_MODNAME=if -c -o arch/i386/kernel/cpu/mtrr/if.o arch/i386/kernel/cpu/mtrr/if.c
arch/i386/kernel/cpu/mtrr/if.c:306: duplicate initializer
arch/i386/kernel/cpu/mtrr/if.c:306: (near initialization for `mtrr_fops.release')
make[4]: *** [arch/i386/kernel/cpu/mtrr/if.o] Error 1
make[3]: *** [arch/i386/kernel/cpu/mtrr] Error 2
make[2]: *** [arch/i386/kernel/cpu] Error 2
make[1]: *** [arch/i386/kernel] Error 2
make: *** [vmlinux] Error 2
oscar% vi arch/i386/kernel/cpu/mtrr/if.c

which is caused by:

static struct file_operations mtrr_fops = {
        .owner = THIS_MODULE,
        .open = mtrr_open,
        .read = seq_read,
        .llseek = seq_lseek,
        .release = single_release,
        .write = mtrr_write,
        .ioctl = mtrr_ioctl,
        .release = mtrr_close,
};

single_release is called in mtrr_close so I would guess that removing
".release = single_release," is the way to go (it compiles). Assuming
this is correct here is the patch.

----------
diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
--- a/arch/i386/kernel/cpu/mtrr/if.c Sat Dec 21 18:52:05 2002
+++ b/arch/i386/kernel/cpu/mtrr/if.c Sat Dec 21 18:52:05 2002
@@ -300,7 +300,6 @@
        .open = mtrr_open,
        .read = seq_read,
        .llseek = seq_lseek,
- .release = single_release,
        .write = mtrr_write,
        .ioctl = mtrr_ioctl,
        .release = mtrr_close,
----------

TIA,
Ed Tomlinson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:30 EST