From: Matthew Wilcox (Oracle) Date: Mon, 2 Mar 2020 21:09:00 +0000 (-0500) Subject: maple_tree: no need to rcu_dereference in mtree_empty() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=da9683f694c119eef6772f0ab376bfbb601e6ea3;p=users%2Fjedix%2Flinux-maple.git maple_tree: no need to rcu_dereference in mtree_empty() 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) --- diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index a5d75366b24f3..9c17fdb729541 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -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 */