]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
rework try_then_request_module to do less in non-modular kernels
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 8 Jul 2008 17:00:18 +0000 (19:00 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jul 2008 09:24:29 +0000 (19:24 +1000)
This reworks try_then_request_module to only invoke the "lookup"
function "x" once when the kernel is not modular.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/kmod.h

index 5dc13848891b4840cc68678d6cba2f9d232b1aa0..9bdb28d6660f27e2114da17e5481dea94cf57f7b 100644 (file)
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
 extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
+#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
 #else
 static inline int request_module(const char * name, ...) { return -ENOSYS; }
+#define try_then_request_module(x, mod...) (x)
 #endif
 
-#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
 
 struct key;
 struct file;