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... |
Can you post your code? Or, a subset of it.
|
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.. |
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); Code:
#include "Modulea.h" |
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... :) |
All times are GMT -5. The time now is 05:04 AM. |