LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-02-2009, 06:19 AM   #1
rheosiva
LQ Newbie
 
Registered: Jan 2008
Location: india
Distribution: Fedora
Posts: 17

Rep: Reputation: 0
problem with compiler warnings


i am having two driver modules..
i have a "write_init" function inside first driver module.
i have given the following export option to export this function in kernel space..
EXPORT_SYMBOL_GPL(write_init);

Now i have used write_init function in second driver module. which is working properly. but while compiling the second driver module it showings compiler warnings below..

*** Warning: "write_init" undefined...

all the functionality is working though i need to overcome with this warnings any ideas.. i have given proper extern statements also...
 
Old 06-03-2009, 04:49 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
Can you post your code? Or, a subset of it.
 
Old 06-04-2009, 05:37 AM   #3
rheosiva
LQ Newbie
 
Registered: Jan 2008
Location: india
Distribution: Fedora
Posts: 17

Original Poster
Rep: Reputation: 0
Hi Harry,

please see the code below...

i am having two modules say module A and module B..

In module A:
init_vvv_module()
{
// module initialization....
}
clean_vvv_module()
{
// module exit code....
}

int write_init(int option, int value)
{
//Some code invocation... i have done it here...
}

EXPORT_SYMBOL_GPL(write_init);
module_init(init_vvv_module);
module_exit(clean_vvv_module);
MODULE_AUTHOR("XXXXXXXXXXXXXXXXXXXXXXXXXXX");
MODULE_DESCRIPTION("YYYYYYYYYYYYYYYYYYYYYY.");
MODULE_LICENSE("GPL");


In Module B:
init_xxx_module()
{
here i am using that write_init(); guessing that while loading module kernel can find the function... because i have done EXPORT_SYMBOL_GPL(write_init);...
}

now the expected functionality is working fine...
Problem is while compiling Module B.. it shows warnings write_init undefined..
i have given the extern also.. but still showing the warnings..
This i need to rectify...
UR suggestion may helpfull to me..
 
Old 06-04-2009, 05:14 PM   #4
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
I have never done a kernel module; but, from my experience I think the error you are getting means the function in not defined in a header file. For example:

Modulea.h

Code:
int write_init(int option, int value);
Module2.c

Code:
#include "Modulea.h"

nit_xxx_module()
{
here i am using that write_init(); guessing that while loading module kernel can find the function... because i have done EXPORT_SYMBOL_GPL(write_init);...
}


.....
I hope that helps in some way/
 
Old 06-05-2009, 07:24 AM   #5
rheosiva
LQ Newbie
 
Registered: Jan 2008
Location: india
Distribution: Fedora
Posts: 17

Original Poster
Rep: Reputation: 0
Sorry harry..
Eventhough i have included the file moduleA's .h file. Also that moduleA's.h has extern of the write_init function. it didnt work properly..
So i am trying to find some other way..

Thanks for Reply...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 01:35 PM
LXer: Linux: Compiler Warnings LXer Syndicated Linux News 0 05-24-2007 10:01 PM
java compiler warnings exodist Programming 2 05-09-2004 02:42 AM
Compiler Problem ixion Linux - Software 2 06-17-2003 08:28 PM


All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration