Skip to contentSkip to conversation

compile error mtrr/if.c

PATCH New Ed Tomlinson 1 participant 1 message Dec 21, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compile error mtrr/if.c

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.

----------

arch/i386/kernel/cpu/mtrr/if.c Sat Dec 21 18:52:05 2002 +0 -1
diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
@@ -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