rcu: avoid build error for third-party modules
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 24 Oct 2011 11:32:57 +0000 (17:02 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:34 +0000 (00:44 +0530)
The initial definition of __kfree_rcu() checked a static inline function
argument to see if it was a compile-time constant.  Apparently not all
compilers are willing to put up with this at all optimization levels.
Add a nasty comment and remove the warning, relying on the fact that
__kfree_rcu() is called only from kfree_rcu(), which always passes in
a compile-time constant.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
include/linux/rcupdate.h

index 2cf4226ade7e60c11ed6d0a3d3f1a4f90496bc24..6b8fba3847f43ea138f9ba6d75d2a063f3b5f8e2 100644 (file)
@@ -800,13 +800,14 @@ static __always_inline bool __is_kfree_rcu_offset(unsigned long offset)
        return offset < 4096;
 }
 
+/*
+ * Intended to be called only from the kfree_rcu() macro.
+ */
 static __always_inline
 void __kfree_rcu(struct rcu_head *head, unsigned long offset)
 {
        typedef void (*rcu_callback)(struct rcu_head *);
 
-       BUILD_BUG_ON(!__builtin_constant_p(offset));
-
        /* See the kfree_rcu() header comment. */
        BUILD_BUG_ON(!__is_kfree_rcu_offset(offset));