]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
idr: reduce the unneeded check in free_layer()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Thu, 22 May 2014 00:44:09 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:09 +0000 (10:44 +1000)
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>
lib/idr.c

index 9ed37a7a031da4987c489d1503dbceb926ae3241..39158abebad175453b7f9f5a520300c4ac57edd8 100644 (file)
--- 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);
 }