linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [srcu] Can we suppress sparse warning?
@ 2016-11-09 11:36 Tetsuo Handa
  2016-11-09 18:58 ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Tetsuo Handa @ 2016-11-09 11:36 UTC (permalink / raw)
  To: paulmck, josh; +Cc: rostedt, mathieu.desnoyers, jiangshanlai, linux-kernel

Hello.

When I build

---------- test/test.c ----------
#include <linux/module.h>

static int __init test_init(void)
{
        DEFINE_SRCU(srcu);
        int idx = srcu_read_lock(&srcu);
        void *ptr = srcu_dereference(ptr, &srcu);
        srcu_read_unlock(&srcu, idx);
        return -EINVAL;
}

module_init(test_init);
MODULE_LICENSE("GPL");
---------- test/test.c ----------

with C=1 option, I get

  test/test.c:7:21: error: incompatible types in comparison expression (different address spaces)

warning from

--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -605,7 +605,7 @@ static inline void rcu_preempt_sleep_check(void)
        /* Dependency order vs. p above. */ \
        typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \
        RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
-       rcu_dereference_sparse(p, space); \
+       rcu_dereference_sparse(p, space); /** this line **/ \
        ((typeof(*p) __force __kernel *)(________p1)); \
 })
 #define __rcu_dereference_protected(p, c, space) \

. 

I want to use srcu_dereference() at
https://lists.01.org/pipermail/kbuild-all/2016-October/026587.html .
Can we have srcu version of 995f1405610bd844 ("rcu: Suppress sparse
warnings for rcu_dereference_raw()") ?

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-13 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09 11:36 [srcu] Can we suppress sparse warning? Tetsuo Handa
2016-11-09 18:58 ` Paul E. McKenney
2016-11-12 14:26   ` Tetsuo Handa
2016-11-12 19:17     ` Paul E. McKenney
2016-11-13 12:55       ` Tetsuo Handa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).