Re: try_module_get code understanding

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Shreyansh Jain <shreyansh.jain@...>
Cc: <linux-kernel@...>
Date: Thursday, September 27, 2007 - 2:13 am

> I was going through try_module_get function in include/linux/module.h file

Somewhere in module.h you have:

#ifdef MODULE
#define THIS_MODULE (&__this_module)
#else  /* !MODULE */
#define THIS_MODULE ((struct module *)0)
#endif

So this just means, that THIS_MODULE is NULL for compiled in modules
and therefore try_module_get(NULL) succeeds. It's not an error case.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
try_module_get, Shreyansh Jain, (Thu Sep 27, 1:19 am)
Re: , , (Thu Sep 27, 2:14 am)
Re: try_module_get code understanding, Heiko Carstens, (Thu Sep 27, 2:13 am)