From: Lai Jiangshan Date: Fri, 6 Jun 2014 21:37:14 +0000 (-0700) Subject: idr: reduce the unneeded check in free_layer() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=15f3ec3f238a44181e1ae85b3cc2c27b9fece01b;p=deliverable%2Flinux.git 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 Acked-by: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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); }