[RESOLVED] [newbie] Is this function compiled in kernel?
Hello
I have weak C skills, and need to check what this warning means when compiling a driver for the uClinux kernel:
Code:
#if defined(CONFIG_MYPLATFORM)
...
static void driver_init(void)
{
some_func("some string");
}
#else
static void driver_init(void) {}
#endif
The message is: "warning: "driver_init" defined but not used".
I have a couple of question:
1. Does it mean that this function is compiled in the kernel, but just happens not to be called by another function within this file?
2. If this is what it means, is there a better way than grep to find from which other C file this function might be called? The uClinux source code is pretty big, so it could take a long while
3. If the function is compiled in, is there a way to know which one it is (ie. the one in the #if, or the one in the #else)?
Thank you.
Re: [newbie] Is this function compiled in kernel?
Because the function is declared static, it is impossible for it to be called from any other file which does not #include the file this is in (or indirectly do so via another #include).
Re: [newbie] Is this function compiled in kernel?
Thanks for the tip. I'll grep for the include and see from which other file this function is called.