Messages in this thread | | | Date | Thu, 13 Apr 2006 20:57:17 +0200 (MEST) | From | Jan Engelhardt <> | Subject | Re: [PATCH] Kmod optimization |
| |
+/* Test if a module is loaded : must hold module_mutex */ +int is_loaded(const char *module_name); +{ + struct module *mod = find_module(module_name); + + if (!mod) { + return 1; + } + + return 0; +} + +
>Don't use braces when not needed. >Why not make this function inline and put it into a header file?
static inline int is_loaded(const char *module_name) { return find_module(module_name) != NULL; }
Cheers. In that case, I think it can even be "hand-inlined" into the callers.
Jan Engelhardt -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |