+/* 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]