lkml.org 
[lkml]   [2006]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2006-04-13 20:59    [W:0.066 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site