inode_operations , warning: initialization from incompatible pointer type

Posted by djTeller on Stack Overflow See other posts from Stack Overflow or by djTeller
Published on 2010-05-08T12:48:45Z Indexed on 2010/05/08 12:58 UTC
Read the original article Hit count: 214

Hi everyone,

I'm trying to compile a simple Kernel program that read and write from a proc file.

I'm trying to set permission to that file by overriding the permission fp in inode_operations struct (.permission)

static int module_permission(struct inode *inode, int op, struct nameidata *foo)

{ . . . }

static struct inode_operations Inode_Ops_4_Our_Proc_File = {
    .permission = module_permission,        /* check for permissions */

};

Our_Proc_File->proc_iops = &Inode_Ops_4_Our_Proc_File;

For some reason, when I compile this i get -> warning: initialization from incompatible pointer type on the following line:

        .permission = module_permission,        /* check for permissions */

Any idea how to solve this?

Thanks!

© Stack Overflow or respective owner

Related posts about linux-kernel

Related posts about kernel-module