]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0123-rbtree-don-t-include-the-rcu-header.patch
WAR:media:i2c:ov5693: add flip and mirror setting
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0123-rbtree-don-t-include-the-rcu-header.patch
1 From 72f2d51dcc8a3877cc1c7629fa2a0420ebcb7891 Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Wed, 23 Dec 2015 23:36:43 +0100
4 Subject: [PATCH 123/365] rbtree: don't include the rcu header
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 The RCU header pulls in spinlock.h and fails due not yet defined types:
10
11 |In file included from include/linux/spinlock.h:275:0,
12 |                 from include/linux/rcupdate.h:38,
13 |                 from include/linux/rbtree.h:34,
14 |                 from include/linux/rtmutex.h:17,
15 |                 from include/linux/spinlock_types.h:18,
16 |                 from kernel/bounds.c:13:
17 |include/linux/rwlock_rt.h:16:38: error: unknown type name ‘rwlock_t’
18 | extern void __lockfunc rt_write_lock(rwlock_t *rwlock);
19 |                                      ^
20
21 This patch moves the only RCU user from the header file into c file so the
22 inclusion can be avoided.
23
24 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
25 ---
26  include/linux/rbtree.h | 11 ++---------
27  lib/rbtree.c           | 11 +++++++++++
28  2 files changed, 13 insertions(+), 9 deletions(-)
29
30 diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
31 index a5aa7ae..24ddffd 100644
32 --- a/include/linux/rbtree.h
33 +++ b/include/linux/rbtree.h
34 @@ -31,7 +31,6 @@
35  
36  #include <linux/kernel.h>
37  #include <linux/stddef.h>
38 -#include <linux/rcupdate.h>
39  
40  struct rb_node {
41         unsigned long  __rb_parent_color;
42 @@ -86,14 +85,8 @@ static inline void rb_link_node(struct rb_node *node, struct rb_node *parent,
43         *rb_link = node;
44  }
45  
46 -static inline void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
47 -                                   struct rb_node **rb_link)
48 -{
49 -       node->__rb_parent_color = (unsigned long)parent;
50 -       node->rb_left = node->rb_right = NULL;
51 -
52 -       rcu_assign_pointer(*rb_link, node);
53 -}
54 +void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
55 +                     struct rb_node **rb_link);
56  
57  #define rb_entry_safe(ptr, type, member) \
58         ({ typeof(ptr) ____ptr = (ptr); \
59 diff --git a/lib/rbtree.c b/lib/rbtree.c
60 index 1356454..d15d6c4 100644
61 --- a/lib/rbtree.c
62 +++ b/lib/rbtree.c
63 @@ -23,6 +23,7 @@
64  
65  #include <linux/rbtree_augmented.h>
66  #include <linux/export.h>
67 +#include <linux/rcupdate.h>
68  
69  /*
70   * red-black trees properties:  http://en.wikipedia.org/wiki/Rbtree
71 @@ -590,3 +591,13 @@ struct rb_node *rb_first_postorder(const struct rb_root *root)
72         return rb_left_deepest_node(root->rb_node);
73  }
74  EXPORT_SYMBOL(rb_first_postorder);
75 +
76 +void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
77 +                                   struct rb_node **rb_link)
78 +{
79 +       node->__rb_parent_color = (unsigned long)parent;
80 +       node->rb_left = node->rb_right = NULL;
81 +
82 +       rcu_assign_pointer(*rb_link, node);
83 +}
84 +EXPORT_SYMBOL(rb_link_node_rcu);
85 -- 
86 2.7.4
87