Re: [PATCH] Kmod optimization

From: Jan Engelhardt
Date: Thu Apr 13 2006 - 14:57:38 EST



+/* 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/