Re: try_module_get code understanding

2007-09-27 Thread Heiko Carstens
> Then what is return value if my module tries to 'get' a module which does not > exist (and is a module, not in-built)? . Is it '1' ? > Or am I imagining a hypothetical scenario which would not exist? That is not supposed to happen. After a module got unloaded there shouldn't be any objects

Re: try_module_get code understanding

2007-09-27 Thread Shreyansh Jain
Thanks for you reply, please see inline. Heiko Carstens de.ibm.com> writes: > [snip] > > static inline int try_module_get(struct module *module){ > > int ret = 1; <--- error case when !module > > if (module) { > > unsigned int cpu = get_cpu(); > > if

Re: try_module_get code understanding

2007-09-27 Thread Valdis . Kletnieks
On Thu, 27 Sep 2007 05:19:06 -, Shreyansh Jain said: > - > static inline int try_module_get(struct module *module){ > int ret = 1; <--- error case when !module > if (module) { > unsigned int cpu = get_cpu(); > if (likely(module_is_live(module))) >

Re: try_module_get code understanding

2007-09-27 Thread Heiko Carstens
> I was going through try_module_get function in include/linux/module.h file > (2.6.22 stock kernel) - which is like: > > - > static inline int try_module_get(struct module *module){ > int ret = 1; <--- error case when !module > if (module) { > unsigned int cpu = get_cpu(); >

Re: try_module_get code understanding

2007-09-27 Thread Heiko Carstens
I was going through try_module_get function in include/linux/module.h file (2.6.22 stock kernel) - which is like: - static inline int try_module_get(struct module *module){ int ret = 1; --- error case when !module if (module) { unsigned int cpu = get_cpu();

Re: try_module_get code understanding

2007-09-27 Thread Valdis . Kletnieks
On Thu, 27 Sep 2007 05:19:06 -, Shreyansh Jain said: - static inline int try_module_get(struct module *module){ int ret = 1; --- error case when !module if (module) { unsigned int cpu = get_cpu(); if (likely(module_is_live(module)))

Re: try_module_get code understanding

2007-09-27 Thread Shreyansh Jain
Thanks for you reply, please see inline. Heiko Carstens heiko.carstens at de.ibm.com writes: [snip] static inline int try_module_get(struct module *module){ int ret = 1; --- error case when !module if (module) { unsigned int cpu = get_cpu(); if

Re: try_module_get code understanding

2007-09-27 Thread Heiko Carstens
Then what is return value if my module tries to 'get' a module which does not exist (and is a module, not in-built)? . Is it '1' ? Or am I imagining a hypothetical scenario which would not exist? That is not supposed to happen. After a module got unloaded there shouldn't be any objects around

try_module_get code understanding

2007-09-26 Thread Shreyansh Jain
Dear List, I agree that this issue certainly doesn't require to be in this list (rightful place being kernewbies) but I tried that and got no response - so trying my luck here. I was going through try_module_get function in include/linux/module.h file (2.6.22 stock kernel) - which is like:

try_module_get code understanding

2007-09-26 Thread Shreyansh Jain
Dear List, I agree that this issue certainly doesn't require to be in this list (rightful place being kernewbies) but I tried that and got no response - so trying my luck here. I was going through try_module_get function in include/linux/module.h file (2.6.22 stock kernel) - which is like: