summaryrefslogtreecommitdiffstats
path: root/lib/idr.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2014-06-06 14:37:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 16:08:12 -0700
commit15f3ec3f238a44181e1ae85b3cc2c27b9fece01b (patch)
treea8bdb83f4c4b224fa33bc4dfc5f2ac08b250e980 /lib/idr.c
parentaefb76829742803751725bc75bcdc43fe803ac22 (diff)
downloadlinux-stable-15f3ec3f238a44181e1ae85b3cc2c27b9fece01b.tar.gz
linux-stable-15f3ec3f238a44181e1ae85b3cc2c27b9fece01b.tar.bz2
linux-stable-15f3ec3f238a44181e1ae85b3cc2c27b9fece01b.zip
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/idr.c')
-rw-r--r--lib/idr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/idr.c b/lib/idr.c
index 9ed37a7a031d..39158abebad1 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -145,7 +145,7 @@ static void idr_layer_rcu_free(struct rcu_head *head)
static inline void free_layer(struct idr *idr, struct idr_layer *p)
{
- if (idr->hint && idr->hint == p)
+ if (idr->hint == p)
RCU_INIT_POINTER(idr->hint, NULL);
call_rcu(&p->rcu_head, idr_layer_rcu_free);
}