make error in building sample code!
loody
miloody at gmail.com
Thu Jun 23 10:06:08 EDT 2011
hi :
sorry for pick up this old thread.
2009/8/4 Robert P. J. Day <rpjday at crashcourse.ca>:
> On Tue, 4 Aug 2009, Greg Peter wrote:
>
>> Hello,
>>
>> I am trying to build LDD3 sample code, just to get expirement around.
>> (Obtained from the link ->
>> http://oreilly.com.cn/codeexample/ldd3/examples.tar.gz).
>>
>> But I get the following errors when I run make: (PS note, I have the kernel
>> source and headers installed)
>>
>>
>> #examples> make
>> for n in misc-progs misc-modules skull scull scullc sculld scullp scullv
>> sbull snull short shortprint pci simple usb tty lddbus; do make -C $n ||
>> exit 1; done
>> make[1]: Entering directory `/home/gregp/examples/misc-progs'
>> cc -O2 -fomit-frame-pointer -Wall
>> -I/lib/modules/2.6.27.23-0.1-pae/build/include setlevel.c -o setlevel
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?syslog?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?type?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?bufp?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?len?
>> setlevel.c:30: warning: data definition has no type or storage class
>> setlevel.c:30: warning: type defaults to ?int? in declaration of ?_syscall3?
>> setlevel.c: In function ?main?:
>> setlevel.c:41: warning: implicit declaration of function ?syslog?
>> make[1]: *** [setlevel] Error 1
>> make[1]: Leaving directory `/home/gregp/examples/misc-progs'
>> make: *** [subdirs] Error 1
>
> those userspace programs still use the now-deprecated and
> unsupported _syscall macros. they should be rewritten to use
> syscall() instead. see:
>
> http://www.kernel.org/doc/man-pages/online/pages/man2/_syscall.2.html
>
I can compile the attach lddbus.c successfully but fail to insert the module.
it is because device_register return a non-zero value.
I have also checked other driver to compare the procedure of initial
"struct device", but I cannot see the difference.
take scsi_debug.c for example:
static struct device pseudo_primary = {
.init_name = "pseudo_0",
.release = pseudo_0_release,
};
static int __init scsi_debug_init(void)
{
......
ret = device_register(&pseudo_primary);
if (ret < 0) {
printk(KERN_WARNING "scsi_debug: device_register error: %d\n",
ret);
goto free_vm;
}
.....
}
is there any CONFIG in kernel i should open for fixing this problem?
--
Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lddbus.c
Type: text/x-csrc
Size: 3926 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110623/db5310c2/attachment-0001.bin
More information about the Kernelnewbies
mailing list