compat: determine if reinit_completion() is present
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 4 Mar 2015 16:57:49 +0000 (11:57 -0500)
committerMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 4 Mar 2015 18:10:33 +0000 (13:10 -0500)
Use HAVE_REINIT_COMPLETION to avoid duplicate definition.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
config/rdma.m4
include/linux/compat-3.13.h

index a804d3a..e2363bf 100644 (file)
@@ -2043,11 +2043,25 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
-                         [idr_Alloc is defined])
-       ],[
+                         [idr_Alloc is defined]) ],[
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if completion.h has reinit_completion])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/completion.h>
+       ],[
+               struct completion c;
+
+               reinit_completion(&c);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
+                         [reinit_completion is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
 ])
 #
 # COMPAT_CONFIG_HEADERS
index 9d40500..88ad581 100644 (file)
@@ -6,8 +6,8 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0))
 
-#ifndef CONFIG_COMPAT_IS_REINIT_COMPLETION
-#define CONFIG_COMPAT_IS_REINIT_COMPLETION
+#ifndef HAVE_REINIT_COMPLETION
+#define HAVE_REINIT_COMPLETION
 
 static inline void reinit_completion(struct completion *x)
 {