]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: no need to rcu_dereference in mtree_empty()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 2 Mar 2020 21:09:00 +0000 (16:09 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:04:29 +0000 (15:04 -0400)
Since we're only comparing the value of the pointer to NULL, we
don't need to use rcu_dereference().  This is explicitly documented
in Documentation/RCU/rcu_dereference.rst.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/maple_tree.h

index a5d75366b24f3e98803df0f61eb6cfbd5df71c1f..9c17fdb729541f3ed4a2d55d19374723f4e8fbcc 100644 (file)
@@ -226,7 +226,7 @@ int mtree_store_range(struct maple_tree *mt, unsigned long first,
  */
 static inline bool mtree_empty(const struct maple_tree *mt)
 {
-       return rcu_dereference(mt->ma_root) == NULL;
+       return mt->ma_root == NULL;
 }
 
 /* Advanced API */