diff --git a/lnet/selftest/selftest.h b/lnet/selftest/selftest.h
index 9e9fb6753928288fb074e77d1e9f9719462352e5..dd977265a4d480ca3cc453ed203898b218223c1e 100644
--- a/lnet/selftest/selftest.h
+++ b/lnet/selftest/selftest.h
@@ -10,11 +10,11 @@
 
 #define LNET_ONLY
 
-#include <libcfs/kp30.h>
-#include <libcfs/libcfs.h>
 #ifndef __KERNEL__
 #include <liblustre.h> /* userland spinlock_t and atomic_t */
 #endif
+#include <libcfs/kp30.h>
+#include <libcfs/libcfs.h>
 #include <lnet/lnet.h>
 #include <lnet/lib-lnet.h>
 #include <lnet/lib-types.h>