diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-06-06 17:37:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:12 -0400 |
commit | 15f3ec3f238a44181e1ae85b3cc2c27b9fece01b (patch) | |
tree | a8bdb83f4c4b224fa33bc4dfc5f2ac08b250e980 /lib | |
parent | aefb76829742803751725bc75bcdc43fe803ac22 (diff) |
idr: reduce the unneeded check in free_layer()
If "idr->hint == p" is true, it also implies "idr->hint" is true(not NULL).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/idr.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -145,7 +145,7 @@ static void idr_layer_rcu_free(struct rcu_head *head) | |||
145 | 145 | ||
146 | static inline void free_layer(struct idr *idr, struct idr_layer *p) | 146 | static inline void free_layer(struct idr *idr, struct idr_layer *p) |
147 | { | 147 | { |
148 | if (idr->hint && idr->hint == p) | 148 | if (idr->hint == p) |
149 | RCU_INIT_POINTER(idr->hint, NULL); | 149 | RCU_INIT_POINTER(idr->hint, NULL); |
150 | call_rcu(&p->rcu_head, idr_layer_rcu_free); | 150 | call_rcu(&p->rcu_head, idr_layer_rcu_free); |
151 | } | 151 | } |