2009/10/9 nidhi mittal hada <nidhimittal19@xxxxxxxxx>
Pasting the code giving error
static void myfs_exit(void)
{
int err=0;
#ifdef DEBUG
printk(KERN_INFO"Unregistering Filesystem myfs");
#endif
if( (err=unregister_filesystem(&myfs)) !=0)
printk(KERN_INFO"Error Unloading filesystem %d ",err);
kmem_cache_destroy(myfs_inode_info_p);
return;
}
static int myfs_init(void)
{
int err;
#ifdef DEBUG
printk(KERN_INFO"Registering Filesystem myfs \n");
#endif
err = register_filesystem(&myfs);
err = init_myfs_inodecache();
if(err)
{
// kmem_cache_destroy(myfs_inode_info_p);
return err;
}
return err;
}
module_exit(myfs_exit);
module_init(myfs_init);On Fri, Oct 9, 2009 at 4:20 PM, Bian Jiang <borderj@xxxxxxxxx> wrote:
On Fri, Oct 9, 2009 at 6:25 PM, nidhi mittal hada <nidhimittal19@xxxxxxxxx> wrote:
Hello i wrote a kernel module
and when i compiled it using make
it gave this type of errors
where i am unable to comprehend why this storage class error is coming in
very simple functions
static int myfs_init(void)
{
.
.
.
}
static void myfs_exit(void)
{
.
.
.
}
module_init(myfs_init);
module_exit(myfs_exit);
error: invalid storage class for function ‘myfs_exit’
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:481: error: invalid storage class for function ‘init_myfs_inodecache’
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:493: error: invalid storage class for function ‘myfs_init’
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:507: error: invalid storage class for function ‘__inittest’
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:507: warning: ‘alias’ attribute ignored
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: error: invalid storage class for function ‘__exittest’
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: warning: ISO C90 forbids mixed declarations and code
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: warning: ‘alias’ attribute ignored
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:510: warning: ISO C90 forbids mixed declarations and code
/home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:512: error: expected declaration or statement at end of input
can someone help in telling in which situation this error comes ?
--
Thanks & Regards
Nidhi Mittal Hada
Please put your complete source code.
--
Bian Jiang
Blog: http://www.wifihack.net/
--
Thanks & Regards
Nidhi Mittal Hada
--
Regards
Chaitanya
+60146458258